its called air conditioning ya pussy.
If you didn't close the door, then obviously the dog got out. then cause of air conditioning, you get a minor inbalance of hot and cold air and that creates a force that pushes the door closed. Sometimes you don't need air conditioning, anything that can change the pressure inside a room can cause this, like opening a window, or opening a door in another room.
What you should be worried about is if you closed the door tightly, and then found it open.