Medications from Mexico are likely to be as good a quality as you get in the States. However, when it comes to bringing certain medications back to America you must be careful. If you are bringing medications that are termed “controlled substances” in the US or Mexico and you don’t have a prescription you could get into trouble. Read more here Buying Prescription Drugs in Mexico | U.S. Consulate General Tijuana, Mexico
but I would say be wary, especially if you are getting medication for someone else – you’ll get into trouble, not them!