Can a Wild Magic sorcerer use Tides of Chaos against the wild magic effect immediately after rolling on the Wild Magic Surge table to recharge it?

My player’s character, a 4th-level Wild Magic sorcerer, cast magic missile as a 2nd-level spell after having previously used Tides of Chaos. Since she had used Tides of Chaos, I had her roll on the Wild Magic Surge table to recharge the feature. She rolled a 07, the dreaded self-fireball. As her character had only 4 HP left, and failed his Dexterity saving throw, he instantly died a spectacular death.

In retrospect, could she have potentially saved her character from instant death by using Tides of Chaos again on the Dexterity saving throw against fireball?

My understanding of the rules was that Tides of Chaos recharges after the wild magic surge is resolved. However, I recently noticed it says that you get it back after rolling on the Wild Magic Surge table, which is arguably complete before the fireball goes off.

Is there any clear rule about this, or is it up to the DM’s judgment?