Yes a bank can reject a direct deposit if it looks suspicious or if the name on the direct deposit and the name on the bank account doesn't match.
Banks are required by the IRS to reject a deposit should the name and the SSN don't match on the bank account and the direct deposit that is being sent to the bank.
This is to prevent people from hiding money from the IRS that they're making.