Neither option is correct. The DM either asks you to roll for Magic Surge, or asks you to roll for Tides of Chaos, but never both.
To clarify, there are 3 possible options:
- DM demands you roll a d20 for possible wild surge, and you roll a 1, rules then demands you roll a d100
- DM demands you roll a d20 for a possible wild surge, and you roll > 1, DM then demands you roll a d100 anyways since you have used Tides of Chaos.
- DM demands you roll a d100 for the wild surge table since you have used Tides of Chaos.
In case 1: You do not regain Tides of Chaos
In case 2: This scenario is not allowed
In case 3: You do regain tides of Chaos.
The reason for this is because both class abilities state "immediately after you cast a level 1 spell". Only one thing can happen "immediately after". Thus, you can't have two things which both trigger on "immediately". The DM has "lost their opportunity" to demand a roll once they have picked on option over the other. So option 2, can't be the correct interpretation. Granted the word immediate is not a key term defined in the rules, however it used in a consistent way within the rules to always preclude some other option. It's my argument that the consistent usage of the word, and lack of use of the word , informs us of the intent of the rules.
Note here that the word "immedately" is not being applied to the game fiction, but rather to what the DM is able to do. The DM gets to choose immediately. Unless there are multiple DMs each choosing their own action at the same time, there is no way to have the word "immediately" mean anything other than an exclusion to the other option.
If the intent of the rule was just to say that after the spell is cast the DM may then ask for a roll on the surge table, there would be no need for the word immediately to be included. For example in the rules for Making a basic attack it says:
You make the attack roll. On a hit, you roll damage.
There is no loss of meaning if the rule was stated:
Any time before you regain the use of this feature, the DM can have you roll on the Wild Magic Surge table after you cast a sorcerer spell of 1st level or higher. You then regain the use of this feature.
The word immediately is used a few times in the rules, also to imply that nothing else can happen between the two events, but never to casually link two dice rolls together. For example, in the spell Delayed Fireball Blast it reads:
On a failed save, the spell ends immediately, causing the bead to erupt in flame.
The contingency spell reads:
The contingent spell takes effect immediately after the circumstance is met for the first time, whether or not you w ant it to. and then contingency ends.
The High Jump and long jump ability says:
feet equal to 3 + your Strength modifier if you move at least 10
feet on foot immediately before the jump.
Similar language is used for the Charger feet. But it is never used for casual causality. (One might argue that this is the only time it does, but that seems like stretch to me.) Immediately is always used to exclude some other action from happening. The only counter argument I can hear to this is that it's to prevent the player from moving before the wild surge die gets rolled, but like in the case with all abilities, you can't move between the attack and damage rolls, so that would be unnecessary here as well.
Just think of the narrative of what is happening here. You cast a spell. That spell casting has a chance of having a wild effect, either the effect has a small chance of happening, or it has a definite chance of happening because of your earlier actions in affecting fate. Suggesting that it does both, based on the same event doesn't fit the narrative, nor the literal meaning of the rules.
This is why there appears to be no other instructions as to when the DM should decide when to ask for a roll. It's the DM's choice which one to choose, but one is always chosen. I can foresee the argument that it does not say "instead of" in either rule, but I believe that is to allow for the possibility for never rolling at all. This allows each table to have the level of chaos that they desire.