There's a historical practice called variolation which involved inoculating healthy people with ground scabs/pus from people with smallpox. They'd make a small scrape on the skin and introduce the material. It was a reasonably protective practice, especially considering the options available at the time.
Iirc, Edward Jenner's smallpox vaccine was based on cowpox, a related but less serious disease.