Actually, protomammals preceded the rise of the dinosaurs. Known as Therapsids they existed in large numbers and varieties but their numbers were reduced by the Permian-Triassic great extinction event. In the Triassic the dinosaur family began to expand in size and variety. More Therapsids were killed off by the Triassic-Jurassic extinction event. Then the dinosaurs got really big, and mammals continued to evolved but hid from the big dinosaurs, getting their big chance when the end Cretaceous event killed off the dinosaurs. Without the competition, mammals then grew bigger than elephants, small like shrews, and everything in between. Canine mammals did not evolve or transition from dinosaurs. Mammals and dinosaurs both evolved in separate branches from the therapsid line. Mammals were only able to dominate after the dinosaurs were gone.
https://en.wikipedia.org/wiki/Therapsid [Evolutionary history of the Therapsid line]
https://www.pinterest.com/mason3452/therapsids/ [Great images of the Therapsid line, many with blog links.]
https://www.thoughtco.com/therapsid-mammal-like-reptile-4043336 [Detailed profiles of various Therapsids.]
Yes - those big sailfin “reptiles” (Dimetrodon etc) from the late Paleozoic are actually proto-mammals, not proto-Dinosaurs. As I recall, the first fossil mammals slightly pre-date the first fossil dinosaurs.