Having nationalized medicine does not mean drug sales don’t occur, it just means the doctor is not the dealer, and often doesn’t run a private practice.
The facilities still purchase drugs and equipment from private manufacturers.
In your example of a socialist country where the doctor is not incentivized to sell Drug A - someone above him still is.
After all, big pharma sells their drugs to government sponsored health systems and hospitals too.
You are running with the idea of socialized medicine to mean that the country actually produces all its own manufacturing, research, etc. and that no capitalism occurs when that’s nowhere near the reality.
There is no such thing as a health system that focuses on preventative care and actually caring for people. The ones that do exist, people like you call “alternative” or wacky while chomping amphetamine pills and going bald from radiation poisoning.