Yes, as long as you're a U.S. resident and plan to remain in the U.S. for the duration of the fund's seven-year holding period.
The exchange fund's tax treatment is governed by U.S. tax law (IRC Section 721). If you're a U.S. resident, that law applies to you regardless of your visa status. H-1B visa holders are fully eligible to participate.
The important caveat: if you plan to return to your home country before the seven-year period ends, the tax treatment becomes more complicated. Countries like India and China may not recognize Section 721 tax deferral, which means your redemption could be treated as a taxable liquidity event under local law. If there's any chance you'll be residing outside the U.S. at redemption, consult a tax advisor familiar with both U.S. and your home country's tax code before contributing.
If you plan to stay and the U.S. is where your financial life will remain, the visa question is largely a non-issue.
For the full residency and citizenship requirements, see What are the residency and citizenship requirements to participate in the exchange fund?