This is "common knowledge" but I've never seen it in real life before.
I've accepted counter offers, as has my wife and quite a few former colleagues. And none of these people were ever let go from that position.
The logic doesn't even makes sense. In large companies, the hiring manager doesn't care about salaries beyond if it fits in the budget. And firing people is a huge pain in the ass. If the company wanted to replace a person with someone cheaper, letting them go would be the best strategy. That would give the company two weeks to get documentation of the job function in place and start interviewing.
I can see this kind of vindictive behavior a very small company, where decisions are made on the whims of a mercurial owner. But you're equally as likely to get fired from a place like this for any number of mundane offenses which the owner finds insulting.
I was told by a manager that HR has a difficult time figuring out salary levels for tech skills. And that an in-hand offer is very effective at convincing them, and upper management to approve a larger than normal pay increase. Worst case, they might just tell me to take it.
They'll fire you on the spot when finally you heal though.
I don’t know, I don’t necessarily think my employer is perfect, but they’re certainly good to me.
Can't underestimate job security in the evaluation of salary.