The head of state of Andorra is the president of France and the bishop of Urgell. Are there any other examples where the head of the state or government is from some other country?
Commonwealth has been mentioned. Apart from that:
- Vatican, where the head of state is customarily from another country
- current prime minister of Czech Republic is from Slovakia (moved there after the breakup of Czechoslovakia)
- current president of Georgia is from France (though born to Georgian immigrants)
- current prime minister of Lebanon was born in Saudi Arabia (but his father was Lebanese)
There were of course many more such cases in the past.
If you go back in time enough, there are plenty of examples:
The British Royal family initially came from Germany, and even if one contends that they're now English that still leaves them Head of State of the three countries in the Union that aren't England, on top of being the Head of State of a heap of former colonies.
The Spanish Royal family came from Austria at one point, and then came from France. (Amusingly, Spain's current Bourbon King is among the claimants to the throne of France.)
The last line of Russian Tzars from Peter III were from the German House of Oldenburg that reigned in Denmark -- which, incidentally, was also foreign.
Hungary had an Austrian Head of State from the moment when the crown fell into Habsburg hands after the Ottomans invaded all the way to WW1.
[Pick any number of other examples where a foreigner ended up a monarch.]
The Pope gets elected amongst candidates from a laundry list of countries.
The Knights of Malta would similarly elect their ruler from one of the 8 langues
Examples are less frequent of late, since there usually is some citizenship requirement to get elected as President or what have you. But there are a few countries that allow a Head of State or Head of Government to have dual nationality that make it possible, and other countries where you don't necessarily need to have been born a citizen to qualify -- naturalization works.
The case of Andorra is the product of history, and the Head of State basically has no role to speak of. I'm not privy with the specifics but you might find other similar oddballs if you dig into the world's laundry list of microstates.
The biggest example is the countries that have the Monarch of the United Kingdom as their head of state. Currently there are fifteen, plus the UK itself.
For many of these states the Queen is not simply from another country, but may not be a citizen or resident of the country, and theoretically may never have visited it. (I believe the current Queen has visited all the states that acknowledge her as head of state, but it took her 30 years to visit St Kitts)