No, banks are not allowed to use housing benefit or any other benefit to repay an overdraft.
You can protect your housing benefit payments by telling your bank it should only be used to pay your rent. This protection is called a 'First Right of Appropriation of Funds Order'.
You can use the first right of appropriation on any money being paid into your account. For example, you may want to make sure that your job seekers allowance (JSA) is used to pay your electricity bill and water rates. You will need to tell your bank how to use these payments.
You need to write to your bank at least seven days before your housing benefit is due, making it clear that any regular payments or future deposits from Ipswich Borough Council are to pay for your rent only.
For example, you may want to instruct your bank or building society:
"On or around August 20th, and every 2 weeks after, my housing benefit will be paid into my current account number 0101010101. I am exercising my first right of appropriation over these funds and wish you to pay the following items from it: £75 standing order payable to my landlord, Mr Smith on the 25th of the month."
Keep a copy of the letter in case there is any dispute later. You may want to ask your bank/building society for a written acknowledgement of your instructions.
If there are any items you no longer want to pay from your account, or which you cannot afford, you should give your bank separate cancellation instructions. This is because the first right of appropriation does not stop the bank paying items as well as those you have listed. If you do not cancel these items, your bank may return the items as unpaid, which they may charge you for. However, payments from your account to re-pay a loan with the same bank cannot be cancelled.