It doesn’t appear that Hugh Jackman and Zac Efron were necessarily in a lot of danger as it appears the filming of the scene was over when the set actually burned down.
The way Efron tells MTV about the experience, it’s hard to tell exactly how much time passed between the end of shooting and the set burning down.
It doesn’t sound like anybody was actually hurt, but one doesn’t usually plan for things to burn down.