Science describes a large set of observations. Whether that set of observations is or reveals reality or not is a question for philosophy, not science.
Most philosophers got bored with this particular question a few decades ago. It is generaly considered not answerable.
It doesn't matter anyway. Whether kicking a rock makes your foot hurt or God's dream of you kicking His dream of a rock makes Him dream that your foot hurts, it is advisible to avoid it.
The reason that it makes a difference in The Matrix is that there are ways to exploit incompleteness in the illusion. In a perfect Matrix, neither pill works.