Three thoughts:
1) Yes, when you quit Job X and join the military, you are in the military and you do what you joined to do. Doesn't matter what Job X was.
2) Quitting mid-intern year is likely to be the act that forever burns all bridges between you and medicine. You really ought to finish the year unless you're absolutely 100% positive you want out of medicine and will never go back. However miserable the year has been so far, you can gut it out and finish.
3) If things aren't working out at your current program and you're failing for whatever reason, do not quit and join the military, thinking that in a little while you'll be able to slide into an internship slot at a military hospital. Military GME programs are not second chances for people who screw up in the civilian world. Our PGY-1 slots are more or less full every year, and to put it bluntly, we don't want civilian rejects and retreads, and we're not so hard up for bodies that we'll take anyone who applies.