It does not. It certainly does act like it feels pain. And in a few minutes it dies.
The ant itself might not feel pain but the ant colony as a whole does feel "pain", the reason for this is that an ant is the equivalent to a human cell. It doesn't feel pain by itself.
To verify this, just find a big ant colony (with hundreds of ants above ground, doing their stuff) and then step on some ants and you will see them completely freak and try to find the attacker so that it doesn't cause any more "pain" the colony.
As for ants:perhaps so. The thing is, ants are really different and interesting. As I said, perhaps some animals don't feel pain, but they'd have to be pretty weird. I would suppose ants qualify, being essentially borg, which is pretty out there. Lobsters, not so much.
If you rip the leg off an ant it keeps going as if nothing happened. Or if you cut an earthworm in half it behaves normally. So clearly not all animals feel pain.
The question becomes which ones do, and which don't. You can't ask them, so at best you watch their behavior and look for changes.
The trouble comes in when you try to distinguish between pain and suffering. Pain prompts an animal to change behavior. A worm being shocked will move away - but does that mean it suffers? Or just that it avoids the negative stimulus?
I can't give you the answer, but at least I can help you understand the question.