You apply from where you are, not on the UK beach, and wait for the decision
No, there is no way to apply for asylum from outside the UK, you can only apply for it when in the UK. And there is no way to obtain a visa to travel to the UK in order to claim asylum.
How do you get of 999,000 scumbags who, btw, "lost" their docs so you don't know where to ship the mother fvckers
Those who fail in applications for asylum should be returned to whichever country they stated they are from. If that isn't actually the country they are from, well, no fault of HMG that the applicant lied.
I'd also condition UK most-favoured-nation trade status on countries agreeing to accept the return of failed applicants, i.e. if any country refuses to accept the return of failed applicants it automatically becomes ineligible for any UK-taxpayer-sourced funding and all products from that country or goods containing products from that country automatically attract punitive import taxes. And also any person connected with any member of the government and/or governing party of that state is automatically barred from entering the UK (including using diplomatic passports).