Well I am no lawyer but I understand it to be legal, except in certain circumstances where you know it is reckless to do so. Or as Chick Hearn would say “no harm, no foul”.
The problem is that yelling fire, true or not, can cause people to Be injured attempting to escape. So in reality always doing this is by definition reckless.
All you have to see is the hundreds of people killed in foreign countries attempting to escape stadiums, night clubs, and the like at the first sign of a disaster, real or not.