The real Pac-Man game is a donut because it's discontinuous at the corners. If two Pac-Men are right next to each other near the top-left corner, and one exits via the top and the other exits via the left, they will end up on opposite sides of the map.
There's a mathematical formalization of this, where the thing you look at is closed paths of Pac-Man leaving a point, traveling around, and returning back to that same point. You group such circuits by whether they can be continuously deformed into each other. The discontinuity at the corners makes two distinct families of circuits, which correspond to traveling on a donut around the circumference vs going through the hole.
A three-dimensional sphere also loops around, but it's not quite the same. One way to get the three-dimensional sphere would be to glue each points at the cube boundary to every other point on the boundary. One way to show that this three-dimensional sphere is not the same as the three-dimensional torus is that in the three-dimensional sphere, you could gather up any tied rope by passing it around the cube boundary.