I suppose the best example of this is in Jonah when he was in the belly of the fish. He said: my prayer came in unto thee, into thine Holy Temple.” (Jonah 2:7). Where was the temple located from the belly of the fish? It was a spiritual expression. Daniel used this same example while in captivity in Babylon when he prayed with his windows open towards Jerusalem. (Daniel 6:10)
Now in the New Testament things are different. Jesus told the Samaritan woman: Woman the hour cometh when neither in this mountain (Gerazim) nor in Jerusalem, worship the Father. They that worship (and pray to) Him must worship Him in spirit and in truth. It is not toward an earthly temple anymore which was destroyed in 70 AD. We who are true Christians are now the temple and the Spirit of God lives in us collectively (I Corinthians 3:16) and individually (I Corinthians 6:19-20). But be careful, God is the same God as in the Old Testament. We don’t lose our salvation but this human temple (our body) can be destroyed.