Just saw a meme online:
Is this safe? What could go wrong?
Odds are in the picture above, the power was off when it was taken.
Usually they shut the power down first and a substation manager directs the firefighters:
Most substations are , although an automatic signal system should summon when an emergency develops. If a utility representative is not present when the firefighters arrive, the utility must be contacted to make sure one has been dispatched.
Most utility personnel are familiar with the substations they service. They are trained in the use of the specialized station firefighting apparatus and can identify the areas that are electrically safe.
Source: Arriving at the scene of a substation fire. What should you do first?
That being said, there are still a lot of dangers from charged capacitors and hot components that need to be worried about even after the power is turned off.
That being said, fires are usually suppressed by automatic systems before firefighers would need to spray water on components.
Huge transformers are equipped by heat detectors form alarm. 4 detectors for each transformer, 2 out of 4 in cross mode make fire alarm and water release command in automatic mode. 2 spray rings with special nozzles for put off the fire. Deluge valves supply the large amount of high pressure water instantly for rings. (Figure 3) https://www.researchgate.net/publication/322789511_Firefighting_systems_in_gas_turbine_power_plant/download
That being said there are many incidents where there wasn't clear communication between first responders and power companies, so it's still a work in progress. The linked document describes NERC procedures and guidance when responding to fires at a substation.