In order to produce a vaccine, researchers have to know what causes the various diseases they want to vaccinate against.
Bad sanitation does not cause disease, it may provide an environment in which disease can be spread, but it is bacteria, or viruses, that cause diseases that there are vaccinations for.
Good hygiene, as well as isolating those infected with a disease, certainly helps stop disease from spreading as much as it would without good hygiene.