Travel to US in H4 while H1B is in process

Is it fine to travel to USA in H4 dependant visa from India when H1B is applied and lottery result pending. If H1B is approved after lottery result ,can I transfer my H4 visa to H1B in USA without issues ?

Appreciate the response.

Yes, you can travel to US on H-4.

Once H-1 is approved, you can either apply for COS from H-4 to H-1 and start working on H-1 once the same is approved. Other option is to leave US and return on stamped H-1 visa.