I will caveat my reply by saying I’m not a Medical Officer or a recruiter;
There are submarine qualified Doctors, SSBN’s carry one and occasionally one will ride an SSN, depending on the op it’s on or the area it’s operating in.
In the case of an SSN the Doc will be a rider, borne for that period and not a part of the ships company. I believe that the Doc on an SSBN is part of the ships company, but when not on patrol I’m sure they will be working out of the sickbay carrying out normal consultations, as would any other non-sm qualified Doctor. I’d be surprised if any Doctor did more than a couple of patrols either.
So while there is the opportunity to earn your dolphins and go to sea I don’t think you’ll find yourself around submarines all the time in the same way that warfare or engineering Officers will.
There are shore jobs other than the sickbay ‘GP’ role for Medical Officers where they like you to have qualified as a submariner, but again that may be a case of only riding a boat to qualify so that you have the appropriate background knowledge and not being a sea-going submarine officer.
About once a year the Officers Technical Course (OTC), which is the initial submarine training course for Officers at the Submarine school, has 3 or 4 newly commissioned doctors on it.
In answer to the question, could you return to General Service after 6 years; I imagine that you will be able to take up any post that any other medical officer can do (provided specific qualifications aren’t required), so yes. Although of course the needs of the service always come first.