What the international law cares about is “sovereign states” or “sovereign subjects of international law” not countries which is a much more informal term. Sovereign states technically don’t even need a territory - 122 states have official diplomatic relations with the Sovereign Military Order of Malta (not to be confused with the Republic of Malta) which has had no territory since 1799.
Nope, you just need to convince a hundred something control freaks on a power trip that you are one of them and that they should give you a bunch of privileges, including legal immunity. Easy.
Did the pope vote in Argentina's election?
Can he? In general, can/do popes vote in their home countries?