They go off by accident all the time. It's happened at our facility (Embraer Aircraft Maintenance Nashville) multiple times in all 3 hangars. Sometimes it's set off accidentally by a maintenance crew. Other times flashes of lightning from a storm trigger the electric eye IR detector that is designed to "see" a fire. Or, it can be triggered by lightning striking the building.
One of our hangars has the sweeping foam cannons in the corners of the hangar. I was working in the hangar on an ERJ-145 in 2013 when lightning from a storm triggered the system. An alarm goes off, strobes start flashing, and you have 10-15 seconds to run to the wall and hit a button and hold it, or the system starts and then I'm not sure how you stop it. After the 10-15 seconds, the button on the wall doesn't work, from my understanding.
That day in June 2013, it filled the hangar with a few inches of foam and water. That stuff stinks, too. Very sulfurous and chemically smell.