Upvote:4
As Greg already explained, the rules are sometimes complex and many things can make a difference in practice. But since you provided your citizenship, I think a brief yet useful overview should be possible. Here are some rules I know about:
First, some countries offer visa-free entry to citizens from every (or almost every) other country in the world. You would therefore obviously be allowed to transit there. Unfortunately, the ones I know (e.g. the Maldives or the Seychelles) are well-known tourism destinations but are not established transit hubs.
Save for a few limited programs, Canada works like the US. Airports are not set up to segregate passengers in transit from local travelers and as a citizen of Sri Lanka you would need a visa to transit there.
European countries typically have a multi-tier system. Unlike US airports, major European hubs do offer visa-free transit facilities but not to all travelers. Unfortunately, Sri Lanka is in the most restrictive category both in the UK and in the Schengen area, which means you will generally need a visa to transit there. Same thing for Hong Kong. More details (including potential exemptions) are available in Do I need a visa to transit (or layover) in the Schengen area? and Is there a way to find out if I need a transit visa for a layover in the UK?
Major hubs in the middle east, like Istanbul or Dubai offer visa-free transit to everybody, including citizens of Sri Lanka.
In the last two cases, the transit rules typically only apply for a short transit with a full service airline at a major hub (but those are the ones you are most likely to go to anyway). Smaller airports might close at night and some airlines might be unable to check your luggage through, in which cases you might need to clear immigration and would therefore have to follow the rule about entering the country.
Upvote:5
Every country has different policies on transit visas. It can depend on any or all of:
So, unfortunately it's not a simple answer. It's true that for the USA, all transit passengers must have a visa (or visa waiver), with no exceptions. There are probably other countries for which this is also true, but the full answer depends on many factors.