I'm trying to identify a Young Adult novel I read when I was, well, a young adult, so it must have been around 1970 (though of course it could have been written much earlier). Two friends visit a carnival where one of the sideshows boasts a live dinosaur. It turns out to be the real thing, brought to the present by the sideshow owner who has a magic ring that enables him to travel in time. There's some sort of accident (possibly a fire) which injures the dinosaur, and the friends use the ring to take it back to its natural time. Most of the novel takes place in the prehistoric past, though I don't recall what exactly happened to them - or indeed why they had to take the dinosaur back, when a modern vet might have been more useful. One thing that sticks in my mind is that the dinosaur was a Cynognathus, whose pet name was 'Nog'.
As confirmed by the OP in a comment, this is "The Anytime Rings", a novel by Robert Faraday (a pseudonym used by Bruce Cassiday) published in 1963. It seems not to have been reprinted, so online information on it is rather sparse. I can confirm, however, that it does deal with the adventures of two children who travel in time with their pet Cynognathus, affectionately known as "Nog".