Laudenum use was extremely widespread historically. It was a 'wonder drug', used by queen Victoria and basically anyone with money, for trivial complaints. Much like Oxycontin now in the USA, it could produce substantial physical and mental pain relief - as long as doses could keep being received. 'Cold turkey' withdrawal from opiates is unpleasant but not dangerous (unlike alcohol addiction withdrawal, which can kill). There is a huge danger from drop in tolerance, and returning to previous doses. Research has shown also environmental factors have massive impacts on psychopharmacology, opiates taken under stressful conditions or in public can have much stronger effects, thought to contribute to many overdoses.
Withdrawal can cause a range of problems. The most serious are related to a lack of reliable strength doses. With Oxycontin, short-term prescriptions were easy to get, but once addicted people couldn't get repeats, or withdrawal support. And so turned to street opiates, of unknown strength. The most reliable treatments for opiate addiction involve supplying the substance, while working on life situation. Fear of enabling addicts saw that abolished in the 'war on drugs' era, but many countries like Portugal & Canada have returned to it. Pursuit of the next dose can be so all-consuming as to prevent any life changes, otherwise.
Heroin is unsafe, primarily because of unreliable doses, but also because of mood effects. It depresses breathing, which can interact badly with other drugs, especially alcohol - vomiting while reflexes to deal with being unable to breathe is one of the biggest killers of opiate users. Sudden-stop withdrawal is infamously bad, but gradual dose dropping is proven to avoid these effects. Supposedly safer opiates like Valium, can actually have worse withdrawal experiences that are harder to manage.
It's been estimated around 85% of hard drug users don't experience problematic use. 5% of people in the US have experienced some level of alcohol addiction. The rate is lower, but the physical & life consequences just as serious, and over all use much much higher.
Prohibition is surprisingly modern. The Gin Craze was the first de facto attempt, using an unpayable tariff. Opium was known to be problematic since at least the Opium Wars. It is hard to separate moral panics from real fear of harms. A major factor in drug prohibition was racism, about mixing with Chinese people in the case of opium, and black people in the case of marijuana and heroin (strongly associated with jazz subcultures). Alcohol is woven in to Christian culture, and total prohibition of alcohol has kept proving impossible. Could a culture have had heroin use in the same way? No, because it's a result of modern chemistry. Opium? Yes, for medical use - opiates & chemical derivates are still used for the most serious pain. But fundamentally, they aren't social, people use them as a crutch, people in physical or emotional pain. A similar condition applies to people who become alcoholics, but there is much more scope for positive uses. For this reason, I'd say no.
Cannabis certainly could have become an alternate lead recreational substance - it may do so yet. The huge range of active compounds is only just being explored, with CBDs having nearly miraculous anti-psychotic effects. There is research suggesting cannabinoids mimic compounds found in breastmilk, aimed at ameliorating discomfort, increasing appetite, and triggering neuroplasticity in suckling infants. Just as opioids working on pain reception systems suggest an undealt with pain issue, it's possible cannabis indicates an urge to regress that isn't unproblematic. But alcohol too is a problem for people who want to escape. I'd say the root problem is unwillingness to face our lives, and our world, and if that is dealt with compulsive behaviour of all kinds becomes much less if an issue.