I read this so often and it really baffles me: your HT does not have to allow you to resign! You are not a slave, you have a work contract and you can resign according to the terms of your contract at any time, usually by half term for end of term.
Your HT might try to persuade you to stay and use some emotional blackmail tactics (“but think of the children!”), but there is no way your HT can stop you from resigning. Not “accepting” your resignation is bs. Good luck to you if you want to get out!