Was opium always considered dangerous?

No. Until the 20th century, opium and its derivatives were widely prescribed, advertised, and sold legally; many households kept laudanum (opium dissolved in alcohol) as a remedy for pain or coughs. Only after widespread addiction and overdose deaths did governments begin prohibiting it.