You can always replace nous by on when nous is used a a subject.
Martin et moi, nous allons partir en vacances = Martin et moi, on va partir en vacances.
Nous, nous partons en vacances = Nous, on part en vacances.
Note that on is prevalent in spoken French but nous might be preferred in formal / written French depending on the context.
In other cases, nous cannot be substituted by on:
Nous, nous y allons !=
On, nous y allons.
C’est pas nous != C’est pas
Il nous l’a donné != Il
As a rule of thumb, in everyday language, you can replace “nous” by “on” whenever it is the subject of a conjugated verb, and not at any other time. In other words, it’s not the word “nous” that’s being replaced by “on” in the informal setting, because the word “nous” is very much alive; what’s being replaced are the “nous conjugations.”
Also, as a rule of thumb, such a replacement is extremely likely in the spoken language, except in formal settings.
There is one important class of exceptions, which is when you are dislocating a subject with a tonic pronoun.
C’est nous qui sommes là.
Since “on” is not a tonic pronoun, you can’t say “**c’est on qui…” I think in the informal language, some would say “sont” or maybe “est” here, but this is not (prescriptively) correct.