Undergraduates probably are most likely to be taught by distinguished historians in small classes, where the professor leads discussions and grades papers, at very selective private research universities (such as the Ivies, Chicago, Duke, or Johns Hopkins.) Undergrads are even more likely to be taught by experienced history professors (though not necessarily by the most distinguished history scholars), in small classes with a high level of student-faculty engagement, at liberal arts colleges.
Even when they do, they aren’t necessarily as good at teaching as they are at research. However, especially at large research universities with relatively high student:faculty ratios, the most distinguished professors (whose publications tend to drive up their schools’ graduate program rankings) may not often teach undergraduates. They have some relevance for undergraduate programs, to the extent they reflect the quality of history teaching that may be available to undergraduates. These two rankings are graduate program rankings. US News and the National Research Council both rank university history departments. It is hard to single out a few colleges as having consistently, categorically better undergraduate history programs than anywhere else. If you are interested in Tang Dynasty China you may find the best instruction at one school if you are interested in Colonial North America, you may find better instruction at another.
The answer will vary depending on the subfield(s) of interest you want to consider and on the criteria you apply.