Think my post got lost during the splitting of this thread, but the legal position is that pension contributions are part of salary/contractual entitlements, and are mandatory by statute anyway, unless the employee opts out. It would create a perverse legal situation if an employer who is legally (by statute and by employment contract) is required to contribute to a pension scheme could simply sack an employee and recoup the employer contributions.
The only time (saving truly exceptional edge cases) that cash EQUIVALENT to employer contributions may be recovered (and even then, not without a court order), is if the employment was gained fraudulently, (e.g. false references, qualifications, identity documents and so on), then the employer could sue the employee in the County Court as the victim of a fraud, and it is possible that a District Judge would rule that the pension contributions where as a direct result of deception, and that not for the fraud, would not have been otherwise enjoyed or obtained by the employee, should be repaid either fully or partially. However, (again save for exceptional cases), the cash could not be simply recovered from the pension fund, once it is there, it is only payable to the beneficiary or generally nominated persons on their death.
Even recovery via the County Court would be a very high bar to meet, because the employer would have to prove that they took every opportunity to mitigate their losses, e.g. pre employment due diligence, reacted quickly, and more than likely would have to prove that the company got no (or not the full) benefit from the employee (even with fraudulent qualifications). Even a fraudulent employee can be a productive, revenue generating one.
Simply garnishing / deducting from last wages/notice period etc would almost certainly be unlawful, with the employee having strong recourse to remedy in an Employment Tribunal / ACAS negotiation.
So, in essence, once the money is in the pension pot, it ain't getting back out!