This is a country-by-country issue and it breaks down by immigration (person) and customs (baggage). It is also more complex as there are regions such as Schengen which are supra-national but are a functional common border (although perhaps less so these days).
Security is a different issue. That may vary by nation, by airport, by destination or arrival point.
If you have a specific routing in mind, that would be helpful.