It's possible to achieve a pretty high rank at a fairly early age in reality, but usually when it's someone very young it enforces that they are a prodigy of some sort.
I'm part of the military in my country, and we have Lieutenants who are in their very early 20s. At least in the British military system, you take a course so that you can become a Commissioned officer, so it's pretty 'easy'.
The highest possible rank in our military is 'Lieutenant Colonel', since we're sort of a 'spin-off' of the British Military.