Pain is just a way for something to know it's taking damage of some sort. Plants do it.....just not in the way we think of it. It might be good for robots to "know" when some activity is damaging them so they can put a stop to it. I think we're pretty far off from them becoming self-aware and killing us all off.
A Buddhist temple on the edge of Beijing is the last place you would expect to find a robot. But the monks of the Longquan Temple have a robot monk called Xian'er. Through a touch screen held on his tummy, he can answer voice commands and up to 100 questions on Buddhism.