score:11
There is no general rule, each country sets its own rules for this. Most countries could not care less, but some countries are quite prickly about only accepting applications from residents (eg. many Schengen members), and some countries can't even make up their mind (eg. China, which generally allows visa applications only from residents, unless you apply in Hong Kong!). The enforcement may vary based on what visa you're asking for, there's a thicket of exceptions regarding what you're supposed to do if you're from a country without an embassy or living in a country without an embassy, and not uncommonly various embassies have different ideas about what the rules are supposed to be!
TL;DR, you have to figure these out on a country-by-country basis. If there are specific countries you're interested in, please feel free to ask additional questions.
Upvote:0
If I understand correctly, you are a citizen of a country A, living in a country B and want to apply for a visa of a country C.
In this case all you need is to contact the embassy or consulate of a country C and it does not matter where do you reside.
Upvote:0
As @jpatokal explained, there is no general rule (+1) but often you cannot chose where you apply. Some countries (e.g. the UK and Schengen countries) have rather strict rules and do enforce them (e.g. by demanding you produce the right kind of visa or residence permit and a proof of address for each application).
Incidentally, in those cases, country and citizenship technically do not matter as such but being a resident in the area covered by a specific consulate is what matters. If you want to go to France and your address is in one US state, then you have to apply at the relevant consulate and cannot do it elsewhere, even at another French consulate in the US. Conversely, if you reside in a small country, the consulate covering the area might very well be in another country.
Unfortunately, if you want to travel flexibly, you might be out of luck, the regulations simply aren't tailored for that.
Upvote:3
This is unfortunately a very complicated issue. My wife made that experience more than once (she bears a Chinese passport) and it's one of her main motivations to get the Swiss passport as soon as she cans (beside political participation).
Since every country has its own rules there is simply no general rule. After all, you have to ask the representation of your destination country in the place you want to apply to. Only they can tell you for sure whether they will accept your submission of the application or not (note: This does not imply any acceptance of the application itself!).
Let's assume the following: You are a citizen of Country Z with a residence permit in Country A, planning to travel to country B.
You have good chances that your submission of an application is accepted if you have a long-term residence permit in Country A (let's say at least 6 months) and the entire validity of the visa you apply for lies completely within the validity of your residence permit. Please note: This does not imply any acceptance towards the application itself! Only the submission of an application may be accepted in such cases.
Some countries allow you to apply for tourist visa in places where you are staying on another visa if you have good reasons to do so (this may include: medical emergencies, family emergencies like accidents/sickness/death of close relatives, etc.), in rare cases a good reason consists already of a well-planned journey. I know of a guy who made it to obtain a Chinese visa in Korea after explaining his travel plans to the authorities there.
In general there is only one rule that applies to any case: The competent authority is the only contact point for reliable information - unfortunately even they can be wrong sometimes. I had the case of a visa of mine for China which was actually not possible to extend anymore but some local authority did - caused me quite some trouble when leaving the country...