Can F1 OPT travel to India while the H1B petition is pending?

Valid F-1 visa and OPT

I am studying no F1 visa and working using OPT work authorization.

H1B selected in the lottery - pending with USCIS

My H1B was selected in this year’s lottery and that case is still pending.

Can travel to India while the H1B petition is pending?

Travel is allowed while H1B is pending

You can travel while the H1B is pending. But, remember that when you are on F1 status in USA and file H1B, it is normally filed with automatic ‘Change of status’.

Travel will abandon H1B change of status

If you travel while your H1B is still pending, the request to change status will be abandoned.

This means that, when you are back in USA on F1 and H1B approved later, you will have to travel outside USA again to get H1B stamped in your passport.

This is simply because you abandoned your H1B change of status application when you went out of USA.