Traveling to India for visa stamping on current petition but got new offer

Hi

Im currently working as a contractual employee for Company A through company B, i.e. Company B is the petition holder. My visa is expired since 2020 and I have applied for visa stamping for H1b + H4(wife) on current Company B petition and got a Dropbox date for Oct. Hence I will be traveling to India in Oct, 2022. Now company A is offering me full- time position. Will I be able to get my stamping done in India for m e and my wife on my current Company B stamping application and travel back to US if I accept the new position and get a H1b transfer before travel? If not what are my options as I don’t want to let this opportunity go? Can I travel to India while my new H1b transfer is under process? Please advise.

If you are still working for company B as of the day you submit dropbox and your application is processed/visa approved, it should be fine to enter using the new company I-797. If your transfer is approved before your application is processed you should update DS160 and use new company I-797 for stamping.