My petitioner has filed H1B petition with premium processing, which gives them 15 days time. Current wait times for H1B embassy appointments are 3 weeks. Do I need to wait for the petition to be approved to file DS-160 and get an appointment or can I already do that?
Fill it out and keep ready and once you get the I-797, update DS-160 and then submit. Your DS-160 will be available online to update and submit for up to 30 days from the date it was created. You can also download a local copy and keep on your computer beyond 30 days.
I think your intention is to block the appointment date as early as possible.
I am not sure if the appointment with the unapproved petition will create any issue or not later. I have not heard of any issue at this time.
The system might allow you to do so as I think it does not check for the petition’s approval internally until the interview date. I am not sure though but I am certain that they do check the approval before visa officer can approve your visa.
You can also refill a new DS160 after booking the appointment if there is any data that needs to be changed.