I’m sure you’ve gotten the “birds are dinosaurs” spiel several times over at this point, so I’ll spare you another, and assume you’re referring to non-avian dinosaurs specifically.
The closest thing we have to a way of measuring the intelligence of extinct animals (and it’s still not very close at all) is by determining their encephalization quotient, or EQ. It’s a common misconception that this is just the ratio of brain mass to body mass – it’s a little more complicated.
It should come as no surprise that different animals have different sized brains. It’s also fairly intuitive that a brain of any given size would be more impressive in a very small animal than a very large one, since it takes up a higher proportion of the body. That’s certainly true – to a certain degree.
If you sort animals by their brain-to-body mass ratio, it quickly becomes clear that this figure alone correlates little with intelligence. Tiny invertebrates like snails often rival primates, mice and men are similar, and the highest ranked animals are small birds.
This is because of the square cube law, a very important concept in biology. If I explained it fully, this answer would become an exhaustive novella, but long story short – brain size does not scale in a linear pattern. The larger an animal gets, the less proportionate brain mass it needs.
Taking this into account, the most widely used EQ formula is brain mass divided by 0.12 times the body mass to the power of two thirds. Now, humans rank highest with an EQ of 7.6. The closest extant animals are toothed whales (up to 5.5) and other great apes (1.6 – 2.7).
So, finally, let’s try to answer your question by comparing modern dinosaurs, birds, and their Mesozoic counterparts. One of the biggest problems with EQ is that it’s mainly based on mammal brains, but since we’re comparing two closely related groups, we’ll hopefully sidestep most of the major caveats.
Among modern birds, corvids such as magpies have the highest EQ, at up to 1.5. This is comparable to a gorilla’s, and is even more impressive considering that bird brains have a higher density of neurons. Other high-ranking birds include parrots (the African grey especially) and hornbills.
How do non-avian dinosaurs fair in comparison? Based solely on the numbers, pretty damn poorly. The highest EQ in this group measured thus far is that of Stenonychosaurus, at 0.3. This puts them at a level comparable to chickens.
While it’s true that troodontids like Stenonychosaurus were probably the most intelligent of the non-avian dinosaurs, 0.3 is surprisingly low. Though chickens are notably quick learners and have limited numerical abilities, their intelligence is unremarkable compared to the likes of crows.
Other dinosaurs fair even worse on the EQ front. Allosaurus is well below any modern bird families, Tyrannosaurus is in the unflattering company of slugs, and herbivores such as sauropods and ceratopsians have the lowest encephalization quotients of any animal ever measured, at an embarrassing 0.011.
Again, this is lower than you’d expect. Of course, it doesn’t mean that the likes of Brachiosaurus were literally the least intelligent animals ever to exist; they had very neuron-dense brains, and they also had auxiliary clusters of nerves on their spinal cord which served as primitive versions of extra brains.