This depends on a case-by-case basis. I am unfortunately unable to give you a fully-fledged answer in general, but would be happy to explain what happened in the Netherlands during the War and the immediate post-war period with (predominantly Belgian) refugees, if you are interested. I could also be of some help in illuminating the emergence of the closed-border and passport systems in the immediate pre-war era, again if you are interested in the context.
Not an answer, but a follow-up question ; How and why did the Ottoman empire dissolute and disappear?
I would be really interested in that SickHobbit, if you have time.