In the US Military, Vegetarian Field Rations were introduced in 1996. To get these you just have to ask (or trade,) as most don't like them anyways. Keep in mind that these are designer meals, 2-3 of these a day will give you all the calories, vitamins, protein, etc needed to remain healthy in a high stress environment.
The Navy is a little harder, being as you get your food from a mess, rather then a prepackaged meal (made by scientists to be as efficient as possible.) You have to make some educated decisions. If you are lacto-ovo, you can use eggs as a protein source (they usually carry no high protein fruits/vegetables/nuts,) if not you should bring a protein source, like soy shakes.
I would say that as a Vegetarian (lacto-ovo), you could make it just fine in the US military. As a Vegan, there would be FAR too many challenges, and it would not be worth it. Also many of the uniforms items are non Vegan (leather, wool, etc.) As a Vegan you would be unable to get proper nutrition in an emergency (as you cannot even eat Vegetarian rations,) I would recommend against the military if you are Vegan.