That would be fair to say, if we (Americans) were free to emigrate to the countries that H1-Bs are being brought in from. We're not. The markets for labor and capital are both far from free (see 'capital controls' regarding the later).
There is some truth is that H1-B influx puts a damp in job hunting. But, from experience, if a programmer feels constantly threatened by that influx to the point of seeing his salary (or even employment opportunities) nosediving, I would question said's person's skills.
The real good engineers in India either come here already in scholarships or transition very quickly from H1-B to resident status. And these are not the majority. The bulk of H1-B are just average/below average (with a good chunk being just atrocious coders) with very little work experience (most of it limited to web development), facing cultural barriers in communication and delivery of work.
This is not a diss or intended as an insult to them. It is just a function of many things that affect their society (and I suspect that the quality of work will improve over the decades.)
If you (the generic "you") are threatened by that, by the current quality of work presented by offshore/H1-B teams, then you are replaceable and possibly not that great at software/IT. Don't blame them. Blame your skills.
If you know your shit well, you will have no shortage of $$$ and work. That is a fact. Do the type of work that cannot be easily offshored/replaced/commoditized, and you will be fine.