If the dog goes in our out through a catflap of the two-flap variety, it would be pretty straightforward to work out which one has opened most recently. You wouldn't even need an arduino.
I'm talking about ones with a big door with a hinge on one side, and set into that is a slightly smaller door with the hinge on the other side. They often have a light magnetic seal. All you'd need is a pair of contacts for the bigger door and another pair for the smaller. A latch circuit if some kind, and there you have it.
A purely mechanical solution might even be possible.