Opium was explicitly used as a tool of war by the British in order to colonize China. You can't look at what happened in the 1800s in China with opium without looking at the entire context in which it happened, how it was spread throughout society, how it was promoted, how it was sold, and how it was weaponized.
Legalizing opium in modern-day society (especially given the current patterns of use) is a very different proposition from what happened during the Opium Wars.