Nothing stops you from doing this.
But one must remember that benefits from Maternity Benefit Act are for good the community and sudden resignations after taking all benefits would make employers wary of employing women.
Ponder over the impact of your action before resigning.
No point saying it is only a single case,there may be others doing it and consolidated the employers would have spent a lot for social cause.