You can resign and go on leave early - you are entitled to go on leave at any stage from 24 weeks of pregnancy. There is nothing to stop you from resigning when you take your maternity leave, you will still be entitled to your maternity benefit - however I'm not sure if a waiting period would be imposed if you wished to sign on for jobseekers once your period of maternity leave/additional maternity leave is up.
If you resign to go on jobseeker's benefit and do not secure another job, you will lose your entitlement to maternity benefit as you must be in insurable employment immediately before your maternity leave commences.