It seems to be the case that some opioid addicts transition from using prescribed medication to illegally obtained medication, which is sometimes illegally produced and adulterated with other drugs. So, it seems that legalizing the recreational use of opiates would enable people to use the "authentic" version of the drug, which is safer.
On the other hand, there are tons of overdoses from prescribed opiates, which are legally obtained; and the overdoses are increasing. Contra my earlier belief, it seems that as access to opiates became easy and legal (via prescriptions), the number of addicts increased dramatically.
This seems to be a situation in which tens of thousands of people will die every year via ingestion of legal drugs unless some kind of intervention is made to remove their access to those drugs. It's hard to see how legalization or decriminalization would make a big difference.