Just checked on this recently
Rules are that you CANNOT use air miles earned on duty flights.
However you CAN collect tier points to enable you to get a gold card and make use of lounges etc.
However Virgin told me that when they book MOD flights that they are supposed to put in a code that prevents air miles being claimed. They also said that if air miles were awarded for such fligth by mistake it was their fault and the miles are yours.. Not sure how this will stand up to beurocratic scrutiny though.