You can not compare it to law school because as someone stated, just about anyone can go to law school. But for medical school, it does matter in many cases. For example, DO applications got thrown out at my residency program (Sorry). You get instant recognition for going to a top tier school. And for certain specialties, it is very, very important. And residency choice can also be very important in terms of future job prospects.
But the question was is the school you go to important like it is in law school.
I didn't say it doesn't matter at all. I know applications from DOs and foreign graduates get tossed out of ACGME residency applications. But the fact is just because you go to a low ranked med school doesn't mean you can't get into ophthalmology, while lawyers have repeatedly said that if you go to a low ranked law school you can't get into big law (or whatever high ranked law specialty/firm there is out there) point blank.
if you want to go in to neurosurgery or ophtho, you are much better off going to a higher ranked school. If you want to go in to family practice, your med school choice will matter less, unless you want a top residency program. There are always exceptions but in general, it matters where you went to med school in terms of residency choice. I would not have been accepted to UCLA for residency if I went to a lower ranked med school.