i've got a kid that's allergic to certain foods and has lots of cavities even though he eats the same things and cares for his teeth the same way his brother, who isn't allergic, does. with my sample size of 1 i can confirm this study
It is established that immune cells are modulated by microbiota - and yes, there are oral microbiota, and there are even oral probiotic supplements one can take which seem to be effective for certain conditions. If you are interested in this topic, I'd recommend paying close attention to how the 2 main strains were discovered (S. Salivarius K12 and M18) - iirc. at least one of the two was first extracted from a child who had no cavities.