Let's say you are a visa national flying into a UK airport with a valid entry clearance. Between exiting the airplane and passing through passport control you have a medical emergency that requires you to be urgently transported to a hospital. What would then happen with your immigration status? Possible options I see:
The immigration officers will search your luggage, find your passport and stamp it - could be tricky if you have your passport on you in the ambulance.
They ask you to report back to the airport once you're healthy for processing.
They send a policeman to watch your hospital ward 24/7 until you are able to go back to the airport.
They give you some sort of emergency entry clearance and you don't have to deal with it in any way.