Like capisce said, a dentist can prescribe any medication for any indication within his/her scope of practice.
The indication matters as much as the drug. I'm on rotation at an emergency clinic this week, and today I had a young woman ask me if I could prescribe her some antibiotics for an, um, intimate problem. I told her she was out of luck and would have to see a physician and cough up another Medicaid copay. Whatever antibiotic her MD prescribes will probably be something dentists use regularly, but the indication is outside dentistry's scope of practice.
Gotta love urgent care patients. 🙄