What does "feel pain" mean? Be conscious of, and distressed by, the pain? Or simply react to a negative stimulus in order to escape it? Organisms that don't even have a nervous system do the latter. If foetal nociceptors are 'firing' it doesn't necessarily mean that the foetus is conscious of the event or experiencing distress.
"By the end of the first trimester (12 weeks) nerve cells are beginning to form rudimentary connections between different areas of the brain. However, these connections are sparse and incapable of performing the same functions as an adult brain. So by 12 weeks, although the fetus is certainly starting to look like a little human, the neural circuits responsible for conscious awareness are yet to develop."
link