Any physician w/ a medical license in their state, and a DEA certificate, can prescribe AAS. The law does not get into specialties!
The key point is whether the doctor wants to get noticed by his state medical board. If someone is acting as essentially a prescription mill for Anabolic Androgenic Steroids (AAS) for BB's, that's seen as very questionable and probably unethical. Most of the patients who receive testosterone from me are middle-aged guys with low test levels and symptoms of hypogonadism.
Occassional prescribing of approved Anabolic Androgenic Steroids (AAS) (test, ox, etc) by any MD or DO is not going to raise any eyebrows in the medical community or at the state medical board.