The only exception to that as I am aware of is toward the general rule with .22LR firearms, longguns and handguns.
And even then that is really only applicable to older type guns not modern who have firing pins these days made of durable metals including alloys and steel.
I dry fire every gun I have and I dry fire them _often_.
Why? Because I train and practice.
As well I reference and actually _read_ the owners manual of my firearms all of which do not state that dry firing is prohibited.
Further I use dummy rounds & snap caps as I'd previously mentioned to work on loading and gun manipulation.
Many people do.
Who ever told you this either was misunderstood, mis-read (hos owners manual) and proved himself to be a person who does not train.
P.S. - Firing pins are generally very much inexpensive and overall easy as pie to replace on most every gun I've ever seen.
To my mind what's more expensive?
A maybe $10 part that will take up maybe 15 to 30m of your time to replace once in a very blue moon...
Or being this guy (FFWD to 5:30) who when push comes to hove fails because he didn't train and run weapon manipulation drills, including dropping the hammer, because possibly he too was concerned about wearing/breaking a maybe $10 part on his life preservation tool.
Train. Parts wear with use and you replace them. Become familiar with your tool(s) as beyond location of the trigger, chamber and magazine tube/well.