As to lawyers, the Rules of Professional Conduct for attorneys promulgated by the Illinois Supreme Court deal with this very explicitly.
RULE 1.7: CONFLICT OF INTEREST: CURRENT CLIENTS
[...]
Official comment:
[12] A lawyer is prohibited from engaging in sexual relationships with a client unless the sexual relationship predates the formation of the client-lawyer relationship. See Rule 1.8(j).
Text of Rule 1,8(j):
(j) A lawyer shall not have sexual relations with a client unless a consensual sexual relationship existed between them when the client-lawyer relationship commenced.
Accordingly, a lawyer could not, under these rules, do something like, for instance, draft a will for a provider and then have sex with her.
On the other hand, should a provider just happen to drop by the lawyer's office or residence, and offer, in a totally consensual and friendly way, to drop to her knees in front of him, lovingly lick his balls and suck his cock, stroke his shaft, rub her tits on his cock, put it back in her mouth and suck until he exploded a great big load of hot wet gooey creamy cum right down her throat, swallow every drop and then slowly suck him hard again, then offering him a choice of various sexual positions of his choice, well that, it would seem, would be a prior consensual sexual relationship that predated the existence or even contemplation of any client-lawyer relationship.
If, after the lawyer had shot a second nice load, he probably would give the very precious and special lady that had been so sweet to him a nice cool beverage and a big kiss, and tell her that she was welcome to stop by any time to do it again. Over drinks, they would probably exchange stories about their lives, during which the provider would be very interested to learn what he did for a living. "I've always thought I should have a will done," she might remark. The lawyer, feeling very affectionate to the nice woman who had just drained him of every drop of his cum, might say, "no problem, I'll write one for you, and pro it pro bono (free), as one of my professional obligations is to provide free legal services to those who can't afford them.