Pediatrician Dr. Spock was a USNR medical officer in WW2. I think he ended the war as a Lieutenant Commander.
Though I think protocol-wise medical doctor - Dr can precede military rank. MDs are always Dr so-n-so before they’re rank so-n-so.