Although no one will catch a “drug overdose” by sitting next to someone on a bus or at a bar, the widespread prevalence of drug abuse in a society does resemble an infectious disease epidemic in other ways.
The origins of the opioid epidemic is more complex, but a difference in policies produces a difference in results. First and foremost, the problem can be prevented by good public health policies and can be made much worse by bad social policies. Take for example the Netherlands, where the COVID-19 case rate soared in March, but had declined sharply by the end of June.