Yes, when Jesus Christ was an infant, he was taken by his parents to Egypt. But Egypt had NO law of which we are aware, prohibiting it. The United States does have laws prohibiting illegal entry, and that is the difference, almost. Joseph was commanded by direct Revelation from God to take the Child to Egypt, which would supersede any law Egypt might have had anyway.
Are these laws biblically justifiable for how we treat those who are here among us?