F1 to H4 COS while H1 is pending

My H1B was picked up in the lottery this year. Case was upgraded to premium and received RFE. My STEM OPT is ending on August 31st 2019. My employer is taking time to respond to the RFE. I do not want to leave to my country if in case my H1b is messed up. I want to wait and see if my employer responds to RFE before August 20th and apply for H4 COS if they do not send RFE documents.

Can I apply for H4 COS while my H1B is pending?
If my H1 is approved after I send H4 application, can I withdraw H4?
If my H1 is rejected after I send H4 application, is H4 receipt notice good for me to maintain legal status?

If you are on F1 OPT, you get cap gap extension until Sep 30th.
If you are not sure, they will process it on time, then you can apply for H4 COS.
Well, you can, it is all about timing, it can be really tricky with timing. You need talk to attorney and plan it well. Yes, if you apply for H4 COS, you will be fine and in period of authorised stay