I'm working from memory here, so I could be wrong, however....
A couple of years ago, when I was a flight commander, one of my chaps was up in front of a military court facing likely dismissal. One of the things I did was check the relevant AP on court proceedings, which included a section on punishments and pensions. I seem to remember that, except in extreme cases, e.g. treason, any pension rights already earned were not generally lost as a result of the court decision.
Standing by to be proved wrong by someone more knowledgable.....
P.S. My chap was dismissed from the RAF.....