I think there's a lot that goes into this.
What do you mean by prestige? prestige of a given med school to the general population? Prestige in the medical field? Saying you went to say Dartmouth might make it sound more prestigious to random people than UCSF, Univ of Washington, whatever. I'm from the Midwest and didn't even know what UCSF was until I started researching med schools.
This leads to my next point, which is that unless you just want a pretty diploma on your wall, or to tell your patients you went to med school at harvard just for fun, presumably you want prestige bc you think it'll help with residency. There again, there's an even larger divide between "prestige" in the public and "people in the know" where those people are a small subset of the medical community. For example, if you told people you did your neurosurg residency at bni, most of the general public and even a lot of people in the medical community would be like "where? Arizona?" where neurosurgeons would likely be impressed. This stuff changes very quickly too. For example, my PI told me last year Miami was a good place to train for NIR fellowship but when I talked to him this year he said that their culture had shifted a bit from IR towards neurosurg so he wasn't sure he'd rank it as high.
Finally, there's what you do with it. My preceptor for primary care is a fabulous clinician who did med school and residency at Yale. He's a family physician in the town he grew up in, and sees a broad spectrum of patients including sometimes 3-4 generations from the same family. My first year PC preceptor went to Michigan for med school and residency and has a thriving clinic targeted towards underserved females. Both are fantastic doctors who are smart and well trained but their patients couldn't care less that they went to top 10 med schools. If you're dead set on a career in academic medicine (I fit into this category) then maybe it will make a difference where you went to med school in getting into residency or whatever, but I think the last segment in your training is the most important or where you end up. If you wind up as a full prof at HMS or Hopkins, are people going to care where you went to med school? One might argue it's harder to get the job otherwise but I'd hypothesize that of all the factors considered, your med school would be down the list.