Participating in a drug deal to convict someone of the crime is certainly one example of them breaking the law. IMHO, they should only be allowed to arrest someone in a drug deal between two bona-fide drug dealers. Participating as one of the two parties in a transaction should be illegal.
I wouldn't be sure, I'm pretty sure legal entities are allowed to employ entrapment in a lot of cases. Watch episodes of Cops, for example, they will attempt to buy drugs and arrest the dealer, or attempt to get people to solicit prostitution from an undercover (female) officer.
Basically, people should stick to the law; dealing drugs or soliciting paid sex are both crimes, no matter who you do it to/with.