This isn't correct.
If you are on an H1B and your employer fires you, you immediately lose your right to live in this country, and to seek work, and must leave in the shortest amount of time you can.
So if your employer doesn't like you shopping around they can stop you.