In countries outside of its borders, a foreign power often has extraterritorial rights over its official representation (such as a consulate).
Do embassies have extraterritorial status?
In international law, extraterritoriality is the state of being exempted from the jurisdiction of local law, usually as the result of diplomatic negotiations. ... Extraterritoriality can also be applied to physical places, such as foreign embassies, military bases of foreign countries, or offices of the United Nations.
Is a consulate considered foreign territory?
Even though embassies and consulates are located in another country, they are legally considered territory of the country they represent. So the host country does not have jurisdiction inside the embassy of a foreign country.