If it were possible to have an intelligent robot, there's no reason to think the same wouldn't be achievable inside, say, a computer game if you gave it artificial inputs.
Except that would never happen. AI rights issues aside, game developers use the least complicated AI they can get away with. AI take CPU cycles better spent elsewhere, and complex AI means long development cycle. Even if we assume humanity has reached the highest possible computational density in our computers, it would still be impractical.
Modern supercomputers are still below the computation needed to run a human mind (brains are highly paralell processors), let alone enough to populate a game world.
That said, special virtual worlds created specifically to house strong AI wouldn't be entirely implausible.
Another thing to keep in mind is death may mean something entirely different for an AI depending on how it was created. An AI similar to Data from Star Trek would likely be very similar to humans, since he was created to emulate a human in terms of input and output. An AI which existed on the Cloud would be very different, due to having vastly different input/output processes and a very different definition of "death." One existing on a terminal would be different from that, and so forth.