[I]n 1735, the primary meaning of the English word 'inoculate' was still 'to set a bud or scion,' as apple trees are cultivated by grafting a stem from one tree onto the roots of another. … [I]n England [inoculation against disease] was often accomplished by making a slit or flap in the skin into which infectious material was placed, like the slit in the bark of a tree that receives the young stem grafted onto it. … [In other words, one was] grafting a disease, which would bear its own fruit, onto the rootstock of the body.
This was before germ theory when there was much uncertainty as to what exactly it was that brought on disease. In the case of smallpox, however, it had long been observed that milkmaids who contracted cowpox seemed to escape the worse disease. If you intentionally introduced cowpox to the body, the less dangerous disease would be induced, and the body would in future be protected from smallpox.
It sounds reasonable, more or less. But I imagine the prospect of grafting a disease to oneself was a frightening affair. The much better tested and far less risky vaccines we use today still manage to scare many silly.
source: "Sentimental Medicine: why we still fear vaccines" by Eula Bliss, Harper's, January 2013