The germ theory dates to late middle ages, and was favored by Avicenna among others, although it did not gain much currency in Europe until the mid 19th century. But it was not needed to discover the success of inoculations, which long predate Jenner, and which were later developed into more elaborate vaccinations. That much was established empirically, see Edward Jenner and the history of smallpox and vaccination by Riedel.
"It was common knowledge that survivors of smallpox became immune to the disease. As early as 430 BC, survivors of smallpox were called upon to nurse the afflicted (9)... However, the most successful way of combating smallpox before the discovery of vaccination was inoculation. The word is derived from the Latin inoculare, meaning “to graft.” Inoculation referred to the subcutaneous instillation of smallpox virus into nonimmune individuals... Inoculation, hereafter referred to as variolation, was likely practiced in Africa, India, and China long before the 18th century, when it was introduced to Europe".
Jenner himself was inoculated with smallpox in 1757, at 8 years old, developed a mild form of the disease, and recovered, so he needed no theory to be convinced. He became a learned man, but those were Newtonian times, when experimental evidence was valued over theoretical speculations in the spirit of hypotheses non fingo. Old school "explanations" were mocked, as in Moliere's "opium puts you to sleep because it has sleep-inducing virtue", and as Jenner's teacher John Hunter wrote in a letter to him:“I think your solution is just. But why think? Why not try the experiment?”
So Jenner collected sixteen case histories since the 1770s, and staged twelve inoculation experiments of his own in 1796-97 instead. Even his idea of replacing infected tissue from human hosts by that from infected animals (which weakens the virus) came from empirical observations, and not theory, see The History Of Vaccines And Immunization by Stern and Markel.
This said, pre-Pasteur theories of inoculation's effectiveness did exist, even as Jenner had no interest in them, see A History of Theories of Acquired Immunity by Silverstein and Bialasiewicz. An early one, based on the humoral theory of disease is due to Rhazes (c. 900), and in Drake's 1707 theory smallpox can recur, but the symptoms do not manifest because the "morbid matter" would escape through the now extended pores and glands as fast as it forms.
In the 18th century, the age of inoculations in Europe, depletion theories came to be popular, which envisioned instead of imbalance of humors some external agent entering the body as the cause, and some depletable substrate in the body as enabling it. Fracastro offered an early such theory back in 1546, which relied on an early form of germ theory inspired by Avicenna:
"It was Fracastoro who first gave formal currency to the idea that not only was
disease caused by small seeds (seminaria), but that the contagion might spread
directly from person to person, indirectly by means of infected clothing, etc., or
even at a distance... The seminaria of
smallpox, he felt, not only had an affinity for blood as Rhazes had suggested, but
more specifically they had an affinity for that trace of menstrual blood with which
each of us was supposed to be tainted in utero, and which thenceforth contaminates
our own blood. In this, Fracastoro picked up and expanded upon an idea advanced
early in the 11th century by Avicenna... As with Rhazes’ theory, that of Fracastoro appeared to explain all of the known
phenomena associated with smallpox, with acquired immunity in this case resulting
from the expulsion during the first illness of the menstrual blood contaminant
without which clinical disease could not recur."
Mather, best known for his role in the Salem witch trials, offered another such theory in 1724, but without identifying the external agent as some kind of germ. Kirkpatrick postulated a depletable “pabulum” in the blood, with which contagious “primordia” united (1754), and Gatti (1764) compared the body to dry wood that a single spark can set afire, but which
becomes “incombustible” thereafter.