Your employment contract should state how much notice the employer must give you to bring it to an end.
This notice must be at least equivalent to the statutory minimum notice, which is a week for each year of service up to a maximum of twelve weeks’ notice after twelve years’ service - unless you behave so badly that the employer is entitled to end the contract immediately – so called “summary” dismissal, for gross misconduct.
A dismissal with the appropriate notice will be a contractually lawful dismissal. (although it may still be unfair).
The Acas Code of Practice on Disciplinary and Grievance Procedures (PDF, 167KB) recommends that employers should tell their employees clearly what constitutes gross misconduct.