Niles and Frasier claimed that in order to avoid the President's Physical Fitness Test, they had lit a match to set off the sprinklers throughout the school. Sprinkler heads will only open up and spray water in the vicinity of the heat source, not all at once.
Frasier sets off a sprinkler in the Rajeski's apartment. While apartments have smoke detectors, they don't have their own sprinkler systems.
Frasier uses a lighter to set off the sprinkler in the Rajeski's apartment. Given that Frasier doesn't smoke, there would be no reason for him to carry a lighter.