Take a look at Hindu mythology. The idea that the world is an illusion or a dream was quite common as far back as 3 or 4 thousand years ago, and has lasted on through the present.
Another version of that belief was made famous by Plato 2500 years ago. Then Zhuangzi's famous "Now I do not know whether I was then a man dreaming I was a butterfly, or whether I am now a butterfly, dreaming I am a man." came about 2300 years ago. Then yet another version by Berkeley about 250 years ago.
The whole "the universe is a simulation" is just the most recent variation, that came about with the advent of computers.