No. A tax refund cannot be direct deposited into a bank that is not in the US. If you have a local bank account then deposit the check instead of trying to cash the check. The bank will accept the deposit but put a hold on payment until the check clears.
The IRS will not issue an electronic deposit to a non-US bank account, and they will not accept requests to make electronic payments after a check has been mailed. (They will re-mail a check if you lose it or damage it.)
You will need to find a bank that accepts US funds. You may find that a bank will deposit the check and hold it until it clears, but won't cash it right away. Or you may be able to open a US bank account online or through the mail. Check with the US embassy or consulate for advice.
I was facing same issue and I'm able to cash out the US treasury cheque through US bank in Malaysia this year. You may try to get advice from Standard Charted bank or Citibank if you have account with them.
As mentioned before on this thread ... a US government check will be accepted however the bank may not cash it right away ... they may require you deposit the check and only have access to the funds once it clears.
What does your local bank rules actually say ? Have they absolutely refused a deposit of the check ?
You should be able to deposit (not cash) a federal treasury check in a foreign bank ... they may have rules as to how long the hold will be on it before they will release the funds.
I'm also facing this issue in Malaysia where all banks, local and foreign (Standard Chartered, HSBC, CitiBank) do not accept US Treasury Checks. They claim it's been halted for a couple of years now, Maybank told me it was since 2016, HSBC since before Covid. Every bank I walked into asked me to verify with the IRS on whether they can do a wire transfer instead.