In many cases, the Seller has signed a listing agreement with his 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.
In some cases, the Buyer pays his agent a commission as set out in their written agreement. If the buyer pays his agent 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
However, 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 could have bought the home for less had it not been listed and the buyer could have dealt directly with the seller.