Isn't the Uk the opposite? There are many visas in which you have to be in the UK to apply. This is why we have people coming on boats, and why they are not illegal immigrants. They technically have to travel here to apply for aslyum, and since they do not have a visa cannot take conventional transport, but it is entirely legal for them to come here on a small boat as long as they present themselves to the authorities to claim aslyum upon arrival.
Graduate visa's are the same for example, where you cannot apply abroad, so you must be careful not to leave the country between graduating and getting that visa.