If you are dismissed with proper reasonable notice you will work out the notice period and your pension will grow by reason of added contributions and length of service. When your job ends, you may still have a claim for pension damages, or you might not.
If you are terminated without reasonable notice, your wrongful dismissal damages will quite often contain a component for your loss of pension. Because your job ends prematurely, your defined benefit pension on retirement (or the value of your investments in a defined contribution pension plan) will be less than should have been the case. Your wrongful dismissal claim will properly include a lump sum amount to represent your lost pension value. The amount of this damage component, if properly advanced on your behalf, will include the amount required to put you in the same overall net position, as if you had worked through a reasonable notice period.
In a defined contribution plan, this is roughly approximated by the employer’s contributions during a reasonable notice period. In a defined benefit plan (ie. you get so much a month on retirement) the employer’s contributions are not the measure of your loss. Rather, you would need to determine (often with an actuary’s help) the actual amount of the loss. Sometimes, if you are wrongfully dismissed just before a key vesting period or milestone, your loss can be large, perhaps even the largest component of your overall claim.