While we can laugh about people using heroin, cocaine and cannabis in over-the-couter medicines years ago, the simple fact is that those medicines were effective, and all the claims in the advertisements were not exaggerated. All it took is good sense not to abuse them. Use in foods, however, is questionable.
The cocaine for toothache and sore throat. Correct. As lozenges, dissolved in the mouth rather than swallowed - wonderfully effective. Xylocaine is what dentists use as a local anaesthetic, and lignocaine gel is used as a painkilling lubricant for catheters.
Heroin for coughs ... certainly, at least to stop the coughs that are unproductive, happening because of the tickle reflex where you cough, if annoys the throat, so you cough more. Codeine is very effective as an antitussive, but to avoid abuse, pholcodine is mainly used now.
As for the cannabis oil - yes - largely because those strains then would resemble the medicinal rather than "for the high" strains available in europe and some parts of the US. "for the high" strains have more THC (tetrahydrocannabinol, lots of high, fewer therapeutic uses although a great dissociative analgesic) than CBD (cannabidiol, not much high, lots of therapeutic uses). Medicinal strains have more CBD than THC. The sad thing is that the cannabis oil has been made illegal even though the stuff is so safe it is almost impossible to kill yourself with an overdose. All the claims check out.
But no ... not in food ... not a good idea ... http://boredomtherapy.com/vintage-ads-for-drugs/