I'm not sure in the UK but in New Zealand, there's a public health system but people have the option to also buy private insurance or pay out of pocket which lets them jump the queue for treatment, stay in nicer facilities (like single person bedrooms when they are hospitalized) or will sometimes pay for new treatments that the public health care system won't.
As an example, there's a years long waiting list for gender affirming care and you have to meet specific criteria, in particular, having a normal range BMI and having taken hormone therapy first. But if you want to get the surgery now, you can pay out of pocket for it and you might be able to find surgeons that are happy to do it even if you don't meet the other criteria.
People sometimes go overseas as well. There are no surgeons in NZ that perform certain procedures and the public system will only pay so much towards someone going overseas for a procedure otherwise not available. So you could rack up some debt that way.
It's the same for IVF as well I think. There's a two year wait list and only two rounds can be publicly funded so some people may pay out of pocket for it. I don't know if it counts as "medical debt" but in NZ it's illegal to pay for a surrogate mother so they're really hard to find here. A know a few gay couples that paid for surrogates overseas which is potentially another way to get into debt.
When I had a cancer scare a few years back I paid a couple hundred out of pocket for an ultrasound instead of waiting nine months to find out the results from a publicly funded one.
So I suppose it's probably possible to rack up medical debt in the UK, but that would more likely be as a result of choices made by the patient than in the US.