Re: "This is a very confused post"
Yes indeed, most countries have laws around refugees and immigration. Are you a refugee, then you apply at the nearest COUNTRY at the nearest port of entry. That means Mexico for most of the people illegally crossing into the US, by the way; but lets put that aside for now. The second way is to get a visa of some kind, permitting you to stay. Then the third category, which is visa waiver programs. All three options involve approaching the port of entry.
ICE on the other hand deal with people illegally crossing the border without going through port of entry. In almost any country in the world, you're bundled into jail awaiting deportation, including if you overstay your visa. Having been an immigrant in more than two continents and more countries I care to name, I can attest to same. If you're deported, in most countries you're escorted to your flight home. In the US, however we have guaranteed due process - you are entitled to go to court and state your case. In the example of Europe, you actually have to apply for permission at that court - which isn't often approved.
"Just not every country does it by separating families"
Thank Obama for that. I for one prefer children NOT to be imprisoned, but that's just me. Bear in mind that the law of separation is actually stemming from a case involving child abuse and sex trafficking. The fact is it was identified that it's common for a desperate person to steal a child, then cross the border with intent to sell them as sex slaves. Yes... that is not only common but an epidemic.
In those cases, and they are not clear which are and which are not; you do not want the child left with the abductor.