1. Show up (on a boat or by crossing the border).
2. File for asylum.
3. You are now a "legal" immigrant.
Asylee, not a legal immigrant. An immigrant is a person who has completed the process and was granted the privilege to cross the border and stay.
BTW, there is no such thing as an "illegal immigrant". All immigrants, by definition, are legal.
Under your scenario, it's still illegal because you were allowed into the country by an idiot who didn't follow the asylum laws.
Those are clear: You must apply while outside where you are not safe.
Applying at the beach in the UK, after a short trip from the safety of France, is a scam, and those who allow it are criminals - even if they are government employees.
The problem is that Western countries are run by stupid, touchy-feely cvnts or pussified men...unable to say no without the risk of being called names.