You guys/gals are evil
Anyway, it really depends on location, and what residency, and what your ultimate goal is (and what are you willing to sacrifice).
Medical training is hard - and most likely, even if you attend a local/regional medical school (whether MD or DO), there will be some traveling involved during 3rd and 4th year (more travel at a DO school compare to MD school, but the amount will depend on the school itself). I've seen some get divorce, but others have maintained their strong relationships throughout this long and arduous process. Probably more people went through residency with their marriage intact (and stronger) than divorce (just based on what I have seen, mileage may vary depending on specialty, hospital, program, expected time commitment, how supportive the program director, faculty, and fellow residents are, etc). But the marriages that remained intact and survived, the spouses knew what they signed up for BEFORE it began, and there was a lot of give/take (spouse will move/relocate for med school and residency, but final location/job will be up to spouse, etc).
Back to your original question - is it possible to attend a local school, and stay locally for residency. YES. And I've seen people do it. For them, stability in their kids lives (not uprooting them) was more important than program, so they stayed for their wives (if wife can't move due to obligations) or for their kids. It will help your prospect if you're from the area and went to a local school (means that you will likely want to stay locally and rank the program highly, plus you will know the local resources and local doctors). As just as important, if you attend school locally, you will have more interactions with that hospital on a professional/educational basis (as a medical student) so you will build stronger connections, which will help for residency.
Also realize that your interests may change, you might realize that your local hospital may not provide the same opportunity as other hospitals which you might be competitive for (ie a large university hospital versus a community hospital, etc), or you may want another specialty than what you intended (ie neurosurgery, ophthalmology, dermatology) - then you will have to decide which is more important to you and your family ... staying put or chasing opportunities.
*if your local hospital is Johns Hopkins, or Mass General, Mayo Rochester, or UCSF, then ignore the above advice.