The earliest show I can think of where a character is trapped inside a video game is .Hack//Sign, which aired in 2002.
However, this isn't purely an anime feature - I read many books with similar situations, some dating before 2002. Example 2002, Example 1998
Presumably this genre is a type of mutation of the 'Trapped in the TV' trope.
It's an easy way to legitimize a fantasy world for an author, so it's become a common staple in teen/young fiction.
Whilst not exactly the same, there are earlier media like The 1980's Dungeons & Dragons cartoon that have characters magically transported to a fantasy world. Or even books like Type Writer in the Sky (1940s) in which characters are transported to a foreign land through the pages of a novel. It's simply modernization of this trope.
So, to answer your question - 2000s and onwards is a good starting point, but you might find similar shows with a slightly different approach earlier than that if you want.