It is possible to do this, however, your resignation may not be accepted by your employers. You will also need to make sure that you do it formally in writing so that all of the necessary paperwork is in place. Make sure that you check your employment contract before you do this though, so that you give the appropriate amount of notice etc. You will not be able to leave with immediate effect. If they write you a reference when you leave, they can still state that a disciplinary procedure was taking place even if you resign, so it is worth thinking about.