I'm former Army, not Navy, so I'll do my best here. A buddy of mine did the Navy nuke program and left about halfway through because he received an appointment to the Naval Academy (one of the enlisted-to-Academy deals). You won't have time to do anything but that while you are in training. Essentially, your first 2 years in the Navy will be learning and studying and doing. Then you go to the fleet where there may or may not be education options available.
Even if education opportunities are available, the mission comes first. If you're a good sailor and work hard, your superiors (I'm not sure what term the Navy uses) will likely work with you to accommodate college courses. If you're a dirtbag, malingerer, PT-failure, always need a haircut, whiny, crybaby, slob, etc., then don't count on anything. As I said, the mission comes first. If you log on to the computer to take a test and halfway through there's a crew drill or something, guess what? Sucks to be you.
You'll likely be exposed to a wide variety of online options. Most of them are junk. Stick only with schools that are regionally-accredited. I always recommend UMUC (University of Maryland-University College) since they have a long history with the military, are regionally-accredited and are part of the University of Maryland system. Most others (Phoenix, Kaplan, Capella, et.al.) are simply taking your money, the taxpayers money and don't provide a qu. Besides, most med schools will only accept credits from a regionally-accredited university anyway, so don't waste your time. But you shouldn't count on being able to complete a degree while you're in. You may be able to knock out some coursework, but you'll only be 24 when you leave the Navy (that's young, BTW!).
If you take courses while in the Navy: 1) don't take anything that will be the foundation of your med school preparation; 2) only take courses that you are interested in; 3) don't take too many at one time; 4) you MUST do well in your courses, regardless of what you take. If you know you want to go into medicine, save all of your med school prerequisite courses for the university you physically attend in person when you're done with your enlistment. However, if you enjoy philosophy, take a philosophy class. If you'd like to learn more about history, take a history class. Consider taking coursework that are considered common core, but in all cases, you MUST do well in them.
The Army has a medal called the Outstanding Volunteer Service Medal. A soldier volunteers for a minimum number of hours and gets a medal. If the Navy has something similar, do this. It will be something to highlight on both your college and medical school applications. While in the Navy, there are always things to volunteer for (I don't mean scrubbing latrines, I mean community service type stuff). Find something and stick with it, and if it's something you can continue with after you leave the Navy, even better.
Above all else, while in the Navy, be the absolute best sailor you can possibly be. Do your job, do it well, and everything will fall into place.
Good luck on your journey...even if it is the Navy...