Modern crocodilians evolved 83.5 million years ago, long after the dinosaurs first evolved. However, primitive animals superficially similar to crocodilians existed since long before dinosaurs evolved.
Crocodiles are descended from a group of reptiles called archosaurs. This group branched into crocodilians and dinosaurs, among others, and also are the ancestors of modern-day birds. Crocodilians were one of the earlier groups to branch off, possibly even appearing before dinosaurs.
The Archosaurs were considered the dominant land animals of the Jurassic Period. These include all non-avian dinosaurs, crocodilians, and pterosaurs. It is generally believed that their modern descendants are modern birds and crocodiles, alligators, caimans, and gharials.
Yes, dinosaurs are related to modern animals. Birds descended from dinosaurs and are their closest relatives. Their second closest living relatives are the crocodilians, the only other remaining archosaurs.