I am a prof in engineering, so the comparison not be perfectly one-to-one, but I’ve seen a fairly wide range in how specialized undergrads are when applying to and entering graduate school. Engineering curricula are so prescribed that there is limited opportunity for specialization anyway. What specialization does occur is due to a small number of elective courses and any undergraduate research experience. The former is usually limited and the latter is generally subject to the available openings in the student’s department at the time they are looking (i.e. luck).
So, as a PI looking for new graduate students, I am not fixated so much on specialization as much as I am on evidence that a student has the academic chops to handle the graduate program and the rest of the basic skills required to handle doing multiple years of research. This means I’d like to see a reasonably high GPA (doesn’t have to be perfect), especially in math and later coursework related to their proposed research area. I’d also like to see research experience (doesn’t matter what field, so much) and a good reference letter from the research advisor that can speak to that students’ ability in the lab.