It is essentially certain that it is possible in principle to construct out of matter a thing which can feel pain, have an experience of self, etc., to the extent that these are meaningful concepts.
The proof is very simple.
Up to this point in human history no rational or scientific model has been presented that would explain how matter could be put together to feel pain. Or feel anything for that matter. Whether it is possible or impossible to do is another conversation.
I encounter many intelligent people (not usually LWers, though) who say that despite our recent scientific advances, human consciousness remains a mystery and currently intractable to science. This is wrong. Empirically distinguishable theories of consciousness have been around for at least 15 years, and the data are beginning to favor some theories over others. For a recent example, see this August 2011 article from Lau & Rosenthal in Trends in Cognitive Sciences, one of my favorite journals. (Review articles, yay!)
Abstract: