I'm in the it's generally not a good idea category. I say this as someone planning to apply to med school next year and who's currently working full-time in one city and commuting to grad school almost full-time in another city 85 miles away. I have a 3 year old rescue I got when he was 3 months old and just adopted another 3 1/2 month old puppy. But I own my own house with a huge fenced backyard and make enough money to pay for things like vet bills and doggy daycare.
The first thing people talk about is the time commitment of med school and the dog being lonely etc. Those aren't the only issues though.
You also have vaccinations, vet bills, pet supplies, dog walker or daycare fees, and other stuff to consider as well. My older dog checked out great at the vet, was active and playful, but he got giardia really bad and needed two rounds of treatment plus probiotics, plus special expensive food after that, then he developed a limp so we needed orthopedic xrays to make sure he didn't have early onset hip dysplasia, was fine but xrays are expensive. Then he had an eyelid deformity that started bothering him quite a bit and it was either meds for life which didn't seem to help that much or surgery. So after all was said and done that first year was about $2700 in big expenses. Not counting other stuff. That might not be typical, but given experiences of my friends with dogs it's not atypical either.
Having a dog is expensive without major issues. You have routine vet exams, vaccinations, heartworm preventative/frontline, food, toys, more toys when bored lonely dog destroys first set of toys, crate, dog bed, treats, etc.
Having a dog, especially a larger breed or anything bigger than 30-50 lbs will make finding housing problematic. A lot of rentals have no pet policies or weight/breed restrictions. So that can really limit your options.
You also can't just look at medical school and having a dog, but also residency when you are a lot busier with a more erratic schedule.
Why did I get another dog then? Well, my older dog seemed kinda lonely with just the two of us, despite doggy daycare twice a week and I figured a companion would be good for him while I'm in med school. But I'm fully prepared to deal with extra costs and difficulty finding housing as well. By the time I'd hit residency, the dogs will be 8 and 10 years old.
tl;dr There are a lot of other issues besides leaving a dog home alone a lot, so unless you have someone to share the burden with like a sig other, get a cat.