When sending coins, the original Bitcoin client picks the more "secure" coins, i.e. the oldest ones that can be used as input for the transaction. Internally, it doesn't care about accounts, although it does of course keep track of each account's balance.
As a result, sending coins back to an input address will only guarantee they will go back to the original wallet, not necessarily the original account, let alone the original person. In many situations wallets are shared between different persons, e.g. in web services (online wallets, mining pools, etc.), so the difference is crucial.
Thus if you're designing an application and you want to allow refund, you should absolutely not rely on the sending address in your application design. Instead, allow people to give an email, a refund address, etc. at some point.
We're talking about the original Bitcoin client here. Although this behaviour is largely justified for security reasons, some current or future clients may not mix addresses between accounts and still be compliant at protocol level.