While there are no IRS rules that specifically forbid you from depositing your refund into someone else's account, we don't recommend it.
Why not? Most banks have fraud-prevention measures that won't allow a direct deposit into an account bearing a different name.
If you decide to enter someone else's account information anyway, chances are the bank will reject the IRS's direct-deposit request because the name on the refund (yours) doesn't match the account holder's.
The IRS will then have to re-process the refund, cut a check, and send it by mail. You'll (eventually) get your refund, but it'll take longer than it would have taken had you requested a check refund in the first place.