Interesting information ksand24. If you aren't eligible for the NHS, but you need services that aren't provided privately - like bookgrl mentioned. Do they charge you for it? I would assume they do.
Yes - anyone can get treatment on the NHS and the NHS is always the first port of call for everyone (if you want private treatment, you usually have to get a referral from an NHS doctor first), but if your visa does not allow free (at point of service) treatment, then you must pay for all of it.
The tricky part is convincing the doctors and NHS staff that you need to be billed for the treatment!
The policy of the NHS is that they are obliged to treat everyone regardless... they cannot turn anyone away. But it is usually assumed that everyone is automatically eligible for free treatment and so they are not used to providing bills to non-eligible patients... so if you aren't allowed free NHS treatment, it is up to you to be aware of this and to chase it up and insist that they bill you.
If you don't pay (and often the NHS staff will tell you that you don't need to, when you know that you do) and you have a NHS debt of over £1,000, you can be refused a UK visa when you apply for one.
The only treatment that is free to absolutely everyone is emergency hospital treatment (and birth control)... but then only the emergency part is free to people who aren't eligible for NHS treatment. So if are treated in the A&E (the ER) but are not eligible for the NHS, then that part is free, but if you are transferred to a ward or given further treatment you have to pay for it.
However, there are not that many people who are not eligible for free NHS treatment - I believe only people on visitor visas or other visas valid less than 6 months are ineligible.
Just a note: the NHS does not work like health insurance companies in the US. It is assumed that the NHS will cover any and all treatment that you need and that it will be the primary method of medical care for everyone. Private insurance is usually just an added extra that you can use to skip the waiting list for operations, and that you can use for things like elective surgery (like cosmetic surgery) that the NHS won't pay for (i.e. the NHS would probably cover breast reconstruction after a mastectomy, but they wouldn't cover breast surgery just because you want bigger boobs). A lot of people might get health insurance through their job benefits, but may not ever use it (I've never had health insurance in my life because I don't see the point - I'm happy with the NHS care I've had in the past).