When humans think of pain we think about the emotional response rather than the firing of neurons. For wasps to experience pain they need to have a consciousness and awareness of themselves. If insects are like robots only responding to stimuli in a preprogrammed way then they could not really be said to feel pain.
Wasps do not feel pain in the same way that humans perceive pain. They can respond to threats or damage to their bodies and will seek to avoid being harmed. Wasps like other insects have sensory neurons that give information to avoid a certain situation but they can not perceive these messages in an emotional way.
We can not know exactly how other animals perceive the world whether it be a dog or a wasp but any sense of pain that wasps do have is going to be very different from the way we think about pain.
The life of a wasp is very efficient in that they live long enough to preserve the species only. All their actions in their relatively short lives are directed to this function. Male wasps only live a matter of weeks as once they have mated their role is complete. At the end of the mating season, all workers will die rather than seek to survive the winter. In this context, pain reflexes are clearly useful but an emotional response to that pain is perhaps not necessary.
How might pain impact wasps over longer periods of time?
Based on research conducted on other insects it may be that pain after an injury alters the behavior of wasps for life. A study conducted at the University of Sydney studied flies to see how they responded to pain over the long term. They inflicted damage to a nerve on the fly’s leg and then allowed it to heal. They found that even after healing the fly became more sensitive than before the injury. While this research was conducted with flies it gives us a clue to the way wasps may also respond to pain. (source)
While in this case, the fly adapts its behavior it is still a physiological response rather than an emotional one. Wasps then do not suffer from pain as humans do but exactly how they perceive pain is unknown.