Driving under the influence of a drug that makes your driving unsafe is permitted:

Under no circumstances

If it is not an illegal drug

If it is a prescription drug

Under no circumstances would driving under the influence of a drug that makes your driving unsafe be permitted. This includes both illegal drugs and prescription drugs. Whether a drug is obtained illegally or prescribed by a doctor, if it impairs your ability to drive safely, it is illegal and dangerous to operate a vehicle while under its influence.