Dinosaurs were vertebrate reptilian lifeforms that lived on Earth from approximately 230 million years ago to 65 million years ago, when a large body impacted on Earth and caused a mass extinction of nearly all the dinosaurs living on the planet. Dinosaurs came in a wide variety of shapes and sizes, with some being carnivorous and others being herbivores.
One of the most advanced dinosaurs to evolve on Earth was the hadrosaur, which prior to the 24th century had been believed to had died out 65 million years ago. However the hadrosaur had not died out, and continued to evolve—eventually becoming the species known as Voth. The Voth eventually left Earth and traveled across the galaxy to the Delta Quadrant. In 2373, the USS Voyager encountered the Voth, revealing that there was intelligent life on Earth before the rise of humanity. (VOY episode: "Distant Origin")
Before the extinction of the dinosaurs on Earth, an alien race believed to be the Preservers were responsible for saving a species of Troodon due to their developing sentience. This species of dinosaur, known as the Clan Ru, would be relocated to a new world where they developed their own society. (TOS novel: First Frontier)
Both Jake Sisko and Kasidy Yates enjoyed reading about dinosaurs during their childhoods. Yates planned to get information on whether Bajor had similar animals, as her place of birth Cestus III had, as she was sure Rebecca would take an interest when she got older. (DS9 - Worlds of Star Trek: Deep Space Nine novel: Bajor: Fragments and Omens)
On the USS Enterprise-D, one of the holodeck programs in the ship's computer was for riding dinosaurs. Riders discovered that while the fatality fail-safe would keep them from serious injury, they would still be hurt if they fell off a dinosaur. (TNG novel: The Devil's Heart)