Even though I agree with your comment, I don't know of any European countries where you could opt-out from paying social security. Even if some small eastern european country has this option, it is probably unsustainable for a larger country (or one with more healthcare spending).
It could be done multiple ways. You could pay into a government insurance scheme or you could pay into a private one. The main point is that the payment of the insurance premiums is decoupled from the service provision. Right now the two are tightly-coupled and you can't realistically choose either of them. Look at the French model as an example.
On a small scale, there is some degree of separation. Sometimes the NHS pays for treatment in private facilities, and sometimes private insurance pays for treatment in NHS facilities.