India to US travel

Hi,

I have a approved H1B Visa stamped from India, My joining date is Jan 2022. I am also planning to visit Dubai in December. Can someone help with details if I can travel from Mumbai to Dubai stay for 45 days and travel from Dubai to US. If yes is there any visa or immigration process to follow.
Or is it better to fly back to Mumbai and take a Direct Mumbai to US flight.