If you are taking a prescription that can impair your ability to drive, then yes you can receive a DUI for driving while on the medication. Many prescription drugs will include warnings on the bottle telling you not to drive while taking the medication. If your medication is prone to cause drowsiness or impair your driving ability in any way, it is best to err on the side of caution and have someone else drive you.