Edward Jenner invented the smallpox vaccine in 1798, the year after Lord Jeff died and 24 years before Pasteur was born.
You didn't need the germ theory to observe that smallpox was communicable. Nor did you need it to observe that persons who had had cowpox tended not to get smallpox. Of course, it did take the likes of Jenner to figure out that you could protect people from smallpox by deliberately exposing them to cowpox.
Exactly. We presume that people in the past, even those in even more ancient times were totally ignorant and not capable of observing basic cause and effect. Granted, before Jenner and others discovered how disease pathogens; how viruses and bacteria caused disease and exactly how they were transmitted, people knew that if you were in close contact with someone who was sick or even in contact with the deceased body or just with their soiled bedding and clothing, that there was a good likelihood that you would also fall ill.
Before germ theory was fully understood, before microscopes were developed and bacteria and viruses identified as disease causing pathogens, people understood the basic concept of disease transmission even if they didnt understand the science involved.
Not all that long ago, it was presumed that bad vapors, i.e. bad smells, i.e. bad vapors were to blame for many diseases and while that wasnt exactly correct, it wasnt all that far off.
Doctors in the Middle Ages during the great plagues, they used robes and masks and even gloves like this when treating plague victims: