The same way that consumer goods are provided in the absence of dollars compensating work, collectively.
Vaccinations would not be enforced, that is not anarchism, that is fascism.
If it can be established that vaccines are both safe and effective, not just profitable, then who wouldn't take their vaccine?
However as long as crapitalism is the rule of the day I wouldn't trust any corporation to introduce any substance into my body.
All problems that arise in an anarchic society would be handled by the locals themselves, when a problem comes to be widespread such as a virus spread through travelers the locals would coordinate a response and look to other localities for examples of effective responses.
Lines of coordination would be established with the first outbreak and fine tuned through each successive outbreak.
With the internet such things can be quickly identified and coordinated responses devised. The knowledge and techniques gained would be retained for the next occurrence.
We would overcome such an occurrence together.