There is nothing in the law that prohibits you giving your notice while you are on medical leave.
There is nothing in the law that prohibits your employer from accepting your notice immediately.
There is no state where accepting an employee's notice immediately will be illegal, medical leave or no medical leave. There is also no state where being on medical leave is a guarantee of employment no matter what.

