Deciding not to return back to work

Does anyone know if you are able to put in your two week notice while still on maternity leave? Or do I need to return back to work and then give them that two week notice?