Just so we are clear ... Illegal immigration is a topic for the society the immigrant is coming from rather than the one he is going to. If you haven't emigrated first and attempt to immigrate the society you are leaving is the one damaged.
We carry laws with us wherever we travel. Those laws are in part derived from the society we were born into. We don't release these bonds just because we get an urge to relocate. The society you attempt to join can have no way to establish bonds (attach new laws) if you have previous bonds not cut.
You cannot be illegal except with respect to laws you are subject to. These laws are where you are from.