The Seller -
In many cases, the seller has signed a listing agreement with the agent specifying a certain fee to be paid for selling the home. It can include provisions for splitting that fee with the selling agent, regardless of agency representation.
The Buyer -
In some cases, the buyer pays the real estate commissions to the brokerage as set out in a written agreement. If the buyer pays the real state commissions from his separate funds, it would not be appropriate for the buyer's agent to also accept part of the fee paid by the seller.
Indirectly, the buyer does pay the real estate commissions.
An argument can be made that the buyer indirectly pays the commission even if it comes from the seller's proceeds. The assumption is that the buyer would have buyer could have bought the house for less had it not been listed and the buyer could have dealt directly with the seller.