I've noticed that my serpentine star pulls back it's tentacle, as if in pain, when it touches one of my plate corals. The same thing happens when my nassarius snail touches the plate coral with it's snout.
This would lead me to believe that the ability to feel pain is a basic reaction for self preservation in most species.
Basic perception of pain (in the sense of recognizing damage or potential damage to the body) is very different from "feeling" pain. Many animals entirely lack any concept of "self", even more lack any concept of time, and we've only been able to demonstrate anything resembling abstract thinking in a tiny handful, most of them mammals.
You starfish for example, lacks a real brain, and is certainly incapable of "feeling" pain.
I'm not sure one way or the other with fish. I've seen enough of them display very normal behavior a short time after what we'd think of as severe trauma that I don't really think they're capable of experiencing psychological pain or worrying.
I still err on the safe side, and whenever I have to euthanize anything I always try to opt for the method that has the least potential to cause pain. For fish, I've used vodka, freezing, and physical destruction of the CNS. Freezing cold vodka seems to kill pretty much instantly, as does destroying the brain either through sufficient acceleratory force (slamming it into a wall) or with sharp scissors. The most "ideal" method would be a fast acting toxin injected directly into the water around the fish to effectively "gas" it without even having to subject it to the stress of removal from its tank, but that's kinda tough to pull off without killing everything else in the tank.
I can understand why some people find killing an animal through physical violence distasteful, but if it's the least painful method that's at your disposal, I see nothing wrong with it. I worked at pet shops for years, and I always recommended that people pre-kill feeder rodents prior to giving them to reptiles by gripping the tail and slamming their head into the wall as hard as they could. It sounds very cruel, but it virtually guarantees instant and painless death, even more reliably than trying to break the neck, and certainly better than anything a reptile would be likely to do.
This is a touchy subject, and in the end a lot of it comes down to personal, subjective feelings.