This is true with regards to measles. It is also true that babies tend to have some level of immunity for the first year (assuming their mother is), which is why the vaccine isn't given until the 12 month mark.
https://www.nhs.uk/common-health-questions/childrens-health/...