In Parshat Vayera, Yaakov leaves home, heading to Charan. On his way, he takes a break, falls asleep and has a dream where God appears to him.
We then read in Breisheet 28: 16-17:
Yaakov awoke from his sleep and said, “Surely God is present in this place, and I did not know it!” Shaken, he said, “How awesome is this place! This is none other than the abode of God, and that is the gateway to heaven.”
Ramban comments that the words “This is none other than the abode of God, and that is the gateway to heaven” refer to the Sanctuary which is the gate through which the prayers and sacrifices ascend to heaven.
Ramban adds: From here you learn that whoever prays in Jerusalem is considered as if they prayed before the Throne of Glory, for the gate of heaven is open there to receive the prayer of Israel, as it is said “and that is the gateway to heaven.”
We learn in the Talmud, Brachot 28b:
While praying, one must face toward the direction of the Holy Temple. One who was riding on a donkey should dismount and pray calmly. If they are unable to dismount, they should turn their face toward the direction of the Temple. If they are unable to turn their face, it is sufficient to focus their heart opposite the Holy of Holies. Similarly, one who was traveling in a ship or on a raft and is unable to turn and face in the direction of Jerusalem should focus their heart opposite the Holy of Holies.
Brachot 30a continues:
One who is standing in prayer in the Diaspora, should focus their heart toward Eretz Yisrael, as it is stated: “And they shall pray to You by way of their land which You have given to their fathers” (I Kings 8:48). One who is standing in Eretz Yisrael, should focus their heart toward Jerusalem, as it is stated: “And they shall pray to the Lord by way of the city that You have chosen” (I Kings 8:44).One who is standing in Jerusalem, should focus his heart toward the Temple, as it is stated: “And they shall pray toward this house” (II Chronicles 6:32). One who is standing in the Temple, should focus his heart toward the Holy of Holies, as it is stated: “And they shall pray toward this place” (I Kings 8:35).One who is standing in the Holy of Holies, should focus his heart toward the seat of the ark-cover, atop the ark, the dwelling place of God’s glory. One who is standing behind the seat of the ark-cover, should imagine that they are standing before the ark-cover and turn toward it.
Consequently, one standing in prayer in the east turns to face west, and one standing in the west, turns to face east. One standing in the south, turns to face north, and one standing in the north, turns to face south; all of the people of Israel find themselves focusing their hearts toward one place, the Holy of Holies in the Temple.
We see from here that all of our prayers pass through Jerusalem and the Temple Mount before ascending to heaven. While technically one can pray anywhere, the closer one can get to the Temple Mount, the better. This is why people from all over the world pray at the Kotel, the Western Wall which is at the footsteps of the Temple Mount and why groups of Jews would like to be granted the opportunity to pray on the Temple Mount.