Actually, that is legal. However, all people must already be outside the building and it must be closed off so the surrounding area does not catch fire. And it's only a last resort. Only when it's clear firefighters can do nothing else.
That picture gives me nightmares. For some reason, I have this small fear of waking up in the middle of the night and my bed is surrounded by flames.