There is NO vaccination against worms in gps,humans or other animals,.
Most of my pigs live to 6 or 7 yrs,sometimes older and I have never wormed.
Worms are very rare in gps,and are only seen in gps kept outside on grass/earth that has been contaminated by cats or dogs.Wild rodents,foxes etc can get worms but they are different to the ones that gps can get.
The type of worms that tortoises are prone to,can be passed on to gps,so if you keep pet tortoises they should be kept well away from ground that your gps use.I have tortoises myself,and they often have to be treated for worms,but they are kept in a seperate compound and not allowed on the lawn which I put my gps out on in good weather.
I have almost 30 years experience with gps and have never seen a piggy with worms.