I have suffered a painful tragedy...I cannot find my copy of Do Androids Dream of Electric Sheep?, the novel by crazy old Philip K. Dick later made into the noir classic Bladerunner. I must have had it since 1972 or so. Cannot remember if it was an Ace or DAW paperback, they are becoming collector's items in their own right. If my search and destroy mission at home does not find its target I will be forced to buy another copy online. So this puts on hold my comparison of the movie version and the book. Just for starters, the book takes place in a depopulated San Francisco, and the movie in an swarming Los Angeles.
The PKD theme of what is reality is evident in the book, raising the question of who we really are...in a broader scope, the question of what outside reality is, is brilliantly dramatized in Time Out of Joint, an early classic, in which a man living in a 1950's suburban enviroment discovers his community was built to trick him, and the real time is decades later. It seems likely to me the writers of The Truman Show were aware of this book and lifted the plot whole.
Another example straight from a PKD short story is Total Recall with a similar plot, this time with interplantetary connections. The Matrix also could be a takeoff on PKD's Ubik, in which people are kept in a half-life state of suspended animation but are able to communicate with the living and sometimes with each other.
This suspicion that all is not as it seems, inspired by a "healthy" dose of paranoia in PKD's case, would be seconded by the buddhists and other mystical traditions, who question our normal acceptance of reality. I recall the head of the Sakya lineage made the remark to a group that what we saw before us was not real. How this can be interpreted is open to dispute, one can belittle such assertions as clerical hocus-pocus to mystify the masses into accepting religous leaders as needed guides to salvation/enlightenment. The buddhist doctrine of sunyata or emptiness is quite subtle and complex, but bascially makes us question the solidity of the physical and mental world.