Current Development
Virtual reality (VR) devices are still mainly used for amusement like in this video of the game Skyrim in virtual reality using Oculus Rift. With augmented reality (AR) devices such as Microsoft's Hololens, Magic Leap and Google Glass we have seen business applications as well. Techcrunch estimates the market for AR and VR devices to grow to $150 billion by 2020.
All in all, the current development suggests there will be a lot more work on creating AR and VR.
For these reasons it seems likely to me that humans will be able to build and partially live in complex simulated-worlds in some hundred years and fully at some indefinite future date. It can be speculated that sooner or later every sufficiently advanced society will have the means to create something like The Matrix.
Although being much more of a feat to accomplish it has been theorized that instead of creating artificial intelligence we might one day be capable of mind uploading / whole brain emulation allowing us to "exist" as a digital version of ourselves with no need for a physical body.
Complementing vs Replacing Reality
It strikes me as rather odd that in most science-fiction movies / literature I have seen the societies pictured – even those hugely advanced compared to ours – either not use VR at all or only as some kind of tool to complement reality – think holodeck – for amusement, training and whatnot.
Assuming we will be able to do whole brain emulation and to create a simulated world as complex as ours wouldn't it be an ingenious solution and panacea to most of our problems to just collectively swear off our earthly bodies and live in a custom-made world replacing what we know as reality?
Surely most present-day humans would be scared of transferring their existence to a simulated world and letting their physical body die but is there anything actually stopping us from doing so besides people's mindsets?
Additional thoughts
Matrix-ception
Given my assumptions are correct and given enough time the following scenario could (have) happen(ed):
A society that once entered a virtual reality designed so that it can not be manipulated from within might still find problems they have not thought of or a severe bug and build a new matrix from within the first one to escape to.
Repeat several times and you would end up with multiple layers of matrices, multiple layers of existence possibly with distorted or removed sensory perception and laws of physics.