It is not illegal to be an affiliate of an online pharmacy, per se. However, if you know, or should have known, that the practices of a particular online pharmacy are illegal and you promote their services you could be in for some trouble. In the U.S. pharmacies are regulated by the individual states, not the federal government. The feds do regulate controlled substances. In practice, both the Feds and the States have had a love/hate relationship with online pharmacies. They love the lower prices, but hate that they are not in control of the situation. Mostly, the legitimate online pharmacies are left alone. This discussion relates to the selling of ethical drugs. The FTC does not like diet pills, weight loss pills and formulas, etc. and have gone after these products based on their claims.
I have heard of cases where the purchase of pharmasuiticals from cross border sites has resulted in the products being confiscated and the recipient being taken to court. So be very careful with getting involved with them.
If you're seriously worried you could hire a lawyer to make sure that marketing for an online pharmacy company is legal for you. As far as I know as long as long as the pharmaceutical company isn't doing anything obviously illegal you should be alright to market for them. I know for a lot of states in the US it is perfectly fine to run an online pharmacy company.