Military personnel, their families and veterans are to have their unique circumstances legally protected by central government for the first time under new plans announced by the Prime Minister.