This is about the US rather than the UK, but here is a relevant article about the treatment at Stanford Hospital of passengers traveling on Asiana Airlines flight 214, which crashed just before the runway at the San Francisco airport.
From the article:
And when they were healthy enough to leave the hospital, they couldn’t
simply be discharged because they had not yet cleared U.S. Immigration
and Customs Enforcement.“They came straight from the runway,” Weiss said. “They weren’t
officially in the United States yet.” Adding to the complication was
the fact that seven were minors unaccompanied by parents.Sitting in open patient rooms and lounges, social workers,
translators, Red Cross and customs officers, as well as a
representative from Asiana Airlines, worked past midnight clearing
patients for release.
I worked in the A&E at Ashford hospital in Middlesex about 20 years ago. Ashford is a couple of miles from Heathrow, and all people requiring hospital assessment from Terminal 4 were brought to us.
I can recall only a couple of times where people were brought from arriving flights not having gone through immigration, but on both occasions they were accompanied by a police officer. They were admitted to the hospital, so I don’t know what happened after they left the Emergency department, except the police officer went off to the ward with them.
Credit:stackoverflow.com‘