It depends almost entirely on what kind of game it is.
If the game has genuine educational value — a maths drill, a geography quiz, a programming puzzle — then there is a reasonable case for allowing it, and some teachers actively build such tools into lessons. Anything outside that category is a different matter. Games with inappropriate content have no place in a classroom, and even perfectly innocent ones become a distraction the moment they are more interesting than the lesson.
A sensible middle ground is what many schools land on: educational titles permitted with a teacher's approval, everything else left at home.