Our cat used to open the bedroom door while we were sleeping, close the door behind him, and jump in the bed for a quality snooze. We had no idea how he did this every night until I woke up and caught him pushing the door closed with his head.
If the door to the basement was closed, but not shut tight, our cat would put her paw under it and pull it open. Our dog...he would stare at it until I opened it. Hmmm...maybe the dog is smarter than the cat.