If your dentist prescribes medicine for you, the office staff will call the pharmacy and have it delivered directly to the dentist's office. You will need to pay for the medicine in cash, but you will save time by not having to look for a pharmacy or stand in line.
However, you may be interested in buying prescription medications because prices are so much lower. Generally, prescription medications can be purchased in Mexico for 40‑60 percent less than they cost in the US. The medications that you purchase in Tijuana will not be the name brand from the US. In most cases, they will be a generic that has been manufactured in Mexico, or overseas. It is the same thing just in a different packaging and produced in a different facility. Be aware that the instructions will probably be in Spanish!
Do not buy more than 90 days worth as that is all you are allowed to bring back into the US. Keep a copy of your prescription for customs.