Plenty of people switch fields between undegrad and graduate school. I have classmates who switched from, for example, undergrad research in quantum physics to graduate research in neuroscience or undergrad research in solid state physics to graduate research in evolutionary biology. Plenty of scientists switch fields thorughout their career (for example, my PhD advisor has a PhD in physics, did a postdoc in biophysics, has a faculty position in a chemistry department, and now has part of the research group working on neurobiology).