Recently retired O-6 physician here. So this kind of continuity can happen, but it is unusual. I did my Navy internship in San Diego, then fleet time as a flight surgeon, then back to SD for residency and fellowship. I left San Diego after fellowship for a 3-year OCONUS tour, returned to San Diego, and then basically didn't leave until retirement (other than deployments and a lot of last-minute TAD). Like, clearing out my office at my retirement was basically archaeology. I am in a relatively small subspecialty community and did a lot of direct operational support stuff when based at the MTF, plus did time as a program director, so there are reasons I never wound up moving. I was also not alone; some of the same people were there with me for the bulk of my tenure. CAPT Schofer mentioned on another thread that there is an intent to preserve a degree of continuity in academic faculty at the larger MTFs, so that affected me as well.
Don't get me wrong, this was unusual, although I know plenty of folks in Bethesda who have done basically the same thing, rotating between different Beltway billets. I also didn't pull any crazy strings to stay in San Diego; when I was up for orders, I submitted my request for extension or re-touring via normal channels and got was I was given. If I had been told to move, I would have done what I did when I was told to be an IA in Afghanistan: saluted and executed the orders. I also don't think the way I did my military career is the best way I could have done it. It worked out well for me and my family, but I regret not doing another OCONUS tour (because that was a highlight of my career) and I think I would have enjoyed another operational tour...a number of my friends served or currently serve as CATF surgeons, and it has been a good experience for them, for example.
The biggest thing I can say is that a lot of my expectations for a "good career" starting out as a new intern turned out to be a bit wrong. I think straight-through training for Navy GME is the right decision and the move away from GMOs is better for care in the fleet, for example, but I also wouldn't have personally traded my time as a flight surgeon for anything. Continuity and homesteading are nice (believe me), but the OCONUS and operational stuff can be the parts of the military that make it worthwhile.
Listen, military medicine goes off its meds every 15 years and attempts suicide.
BTW, for people commenting about lack of continuity of care in the DoD...the outside world will be a little disappointing for you. With the rise of group practices and employed clinicians, I have been a bit disappointed in attitudes about continuity out here. It feels sometimes like surgeons and ID doctors may be the only ones left who care about it. My clinic patients at NMCSD had better continuity than my current practice, even with staff rotating every 3 years or so.