Your employer should follow a fair disciplinary process rather than trying to force you out. Of course, the employer may not want to do this: perhaps because the disciplinary process would take too long, or they want to avoid paying you during your notice period, or there isn’t any good reason for dismissing you.
In principle, you are entitled to resign and then claim unfair dismissal.
In practice, if your employer wants you out the best solution may be to use your lawyer to negotiate a settlement agreement. The employer agrees to pay you a negotiated amount and you give up the right to take them to an employment tribunal or bring a court case. How much you might get will depend on factors such as how long you have worked for them and what your contract says.