In the book, the point is made clearly that Tom finds it very, very difficult to push himself through the closed door - it's such an effort that he has to stop for a rest halfway, and hopes that no-one can see him with his head sticking through one side of the door and his body on the other!
So he only does it on a handful of occasions when he has no other way of getting through. It seems that everything in the garden does feel solid and tangible to him unless he presses very hard against it.
Another example is that he's able to hold Hatty's hand when they play at chasing the fish in the aquarium, but at another time, he strikes at her wrist to prove (as he then thinks) that she's a ghost, and his hand goes through her wrist - or as Hatty argues back, her wrist goes through his hand. It is a bit anomalous, but I've always just accepted it as part of the story; there's obviously something a little magical or supernatural going on in the first place, after all, for him to be able to transcend time and enter the era of Hatty's childhood. So why shouldn't the rest of the laws of physics be a little different for him as well, while he's there?
(Another instance I just thought of - I'm pretty sure that when they're climbing the yew trees, he's aware that if he fell, he wouldn't be hurt in any way.)
That's how I've always seen the other anomaly that others here have mentioned, too - two people wearing the same pair of skates. Tom himself comments inwardly on the strangeness of it as it's happening, but hey, somehow it works!
Ultimately, of course, it's a children's story, not something we're supposed to fit into the constraints of "real life" - especially when the story itself is about those constraints being mysteriously transcended.
That air of mystery is one of the most appealing things about the story, I've always felt; it's never explained exactly how Tom's "time travelling" worked, but it doesn't need an explanation. He and Hatty understand, in the end,
why it happened - because they both needed a friend so much - and they simply accept it. I love the way Tom sums it up in the final chapter: "We're both real: Then and Now. It's as the angel said: Time no longer."