The H1-B or any other US visa stamp is needed to enter the country. You do not need this to exit the US and in many cases you do not need this when you are in the US. But you cannot enter the US (or board a plane to the US) without one (assuming you are not a US citizen or permanent resident).
When you visit a third country they may expect a return ticket in addition to validating you are allowed to enter said country to make sure you exit the country in a timely fashion. If your "return" ticket is to India, there are no additional complications. If your "return" ticket is to the US they may not allow you to enter as you do not have a way to go back to the US (no valid US visa)*. Please look up return ticket requirements for the said country. If you are denied entry, you may end up spending some time in a detention facility while they figure out how to get you to India, which may not be very pleasant.
The bigger question is what is your plan. If you intend to travel to, say, Sri Lanka, and get back to the US, you need to plan to get a visa stamp and figure out where you should get the stamping from. If your plan is to visit the country on the way to India and then return to the US, you should plan to a get a visa stamp in India before returning to the US.
*It is also not uncommon for Indian citizens to get their US visa stamped from a third country in certain specific situations but this does not seem to be your plan.