I read the book a long time ago as a child. If I remember correctly, it was about two kids who found a cave along the shore with dinosaur footprints, and when they followed the footprints into the cave, they would emerge in the era of the dinosaurs. They also met a friendly dinosaur who liked to eat gingko fruits. I think it was part of a series.
The Google Books summary says:
Tom and Jamie can't believe their luck when they find a secret entrance to a prehistoric world filled with dinosaurs!
The first dinosaur they meet is a friendly wannanosaurus. It eats the fruit from super-stinky ginkgo trees. But soon, Tom and Jamie meet a much less friendly dino: a Tyrannosaurus Rex that would like to eat them!