In any place in the world or in Europe, should the prayer be directed to the east (מזרח) always, or it's different from country to country or continent to continent?
הָיָה עוֹמֵד בְּחוּץ לָאָרֶץ — יְכַוֵּין אֶת לִבּוֹ כְּנֶגֶד אֶרֶץ יִשְׂרָאֵל, שֶׁנֶּאֱמַר: ״וְהִתְפַּלְלוּ אֵלֶיךָ דֶּרֶךְ אַרְצָם״. הָיָה עוֹמֵד בְּאֶרֶץ יִשְׂרָאֵל — יְכַוֵּין אֶת לִבּוֹ כְּנֶגֶד יְרוּשָׁלַיִם, שֶׁנֶּאֱמַר: ״וְהִתְפַּלְלוּ אֶל ה׳ דֶּרֶךְ הָעִיר אֲשֶׁר בָּחַרְתָּ״. הָיָה עוֹמֵד בִּירוּשָׁלַיִם — יְכַוֵּין אֶת לִבּוֹ כְּנֶגֶד בֵּית הַמִּקְדָּשׁ, שֶׁנֶּאֱמַר: ״וְהִתְפַּלְלוּ אֶל הַבַּיִת הַזֶּה״. הָיָה עוֹמֵד בְּבֵית הַמִּקְדָּשׁ — יְכַוֵּין אֶת לִבּוֹ כְּנֶגֶד בֵּית קׇדְשֵׁי הַקֳּדָשִׁים, שֶׁנֶּאֱמַר: ״וְהִתְפַּלְלוּ אֶל הַמָּקוֹם הַזֶּה״. הָיָה עוֹמֵד בְּבֵית קׇדְשֵׁי הַקֳּדָשִׁים — יְכַוֵּין אֶת לִבּוֹ כְּנֶגֶד בֵּית הַכַּפּוֹרֶת. הָיָה עוֹמֵד אֲחוֹרֵי בֵּית הַכַּפּוֹרֶת — יִרְאֶה עַצְמוֹ כְּאִילּוּ לִפְנֵי הַכַּפּוֹרֶת. נִמְצָא עוֹמֵד בַּמִּזְרָח מַחֲזִיר פָּנָיו לַמַּעֲרָב. בַּמַּעֲרָב מַחֲזִיר פָּנָיו לַמִּזְרָח. בַּדָּרוֹם — מַחֲזִיר פָּנָיו לַצָּפוֹן. בַּצָּפוֹן — מַחֲזִיר פָּנָיו לַדָּרוֹם. נִמְצְאוּ כׇּל יִשְׂרָאֵל מְכַוְּונִין אֶת לִבָּם לְמָקוֹם אֶחָד.
One who was standing in prayer in the Diaspora, should focus his 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 was standing in Eretz Yisrael, should focus his 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 was 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 was 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 was standing in the Holy of Holies, should focus his heart toward the seat of the ark-cover [kapporet], atop the ark, the dwelling place of God’s glory.
One who was standing behind the seat of the ark-cover, should visualize himself as if 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.
Mishnah Berurah 94:11 writes in the name of the Levush that during prayer one should face the precise location of Jerusalem; thus one would only face directly east if his location was at the same latitude as Jerusalem (although see the end of this answer, where even that may not be true). For most the United States and Europe, one should face southeast.
South of Jerusalem's latitude (approximately 32N), one would face either northeast or northwest, depending on his location relative to Jerusalem's meridian.
It's worth noting that the direction a synagogue faces may not precisely correspond to the direction of Jerusalem, since architectural considerations often come into play.
There is also a dispute among the poskim whether the direction one should face is the shortest distance to Jerusalem, or its compass direction. As the earth is a sphere, these can be very different directions. See this excellent article on MyZmanim for more information about this.
The reason for facing Yerushalayim is to improve kavana. Hence, if there is some extenuating circumstance, prayers may be in any direction needed to improve kavana. For instance, I was once on a flight from NY to Israel where there was a minyan in the back of the plane. Now, regardless of which view you have of the direction toward Jerusalem, it would be hard to argue against the direction of the front of the plane! Yet in this case, the minyan faced backwards, towards New York. Reason? Facing all of those people (including many women) was not conducive to concentration on the prayers.