Yes insects do seem to have the ability to feel pain since an insects nervous system is similar to humans nervous systems that allows us humans to feel pain.
So we can't say for sure if the insect feels pain when hurt or killed because we are not insects but since the insects have a similar nervous system to humans it's very likely that the insects can feel pain.
If it's not pain that they feel something else similar to the pain we feel when hurt.
Insects and other bugs can feel, taste, hear and see just like humans so if we can feel pain then its very likely and safe to say that insects and bugs can feel pain.
But there's no way to know for sure 100 percent.