That depends on the bank. Many banks will refuse a deposit if the taxpayer's name is not the name of the bank account holder. If the bank refuses the deposit, the IRS will mail a check to the address on your tax return.
If you want to cancel direct deposit, you can call the IRS and they might be able to cancel it and mail a check, if you get through to a human, but the IRS won't accept a request to change account numbers for the deposit. 800-829-1040