All day now I've been watching dinosaurs, and all day they've had the same fundamental problem.
They don't believe in firearms. They just don't seem to have been _told_ about them or something. Bullets _bounce_ off of dinosaurs! Maybe it's because they became extinct millions of years before the invention of gunpowder, and the laws of physics were just different back then... Aah, no. Come on. If they're close enough to chemically operate today, they'd have to be vulnerable to fast (even subsonic) lead projectiles. It's that simple.
Look, the toughest-skinned reptiles on the planet today, alligators and crocodiles, are completely vulnerable to basic rifle fire. They're nothing magic. You can shoot a pistol round right through the heavy scales on their backs. They don't take armor-piercing bullets or anything special. Small bullets penetrate them, they just don't kill them. Somewhat (but not REALLY) large bullets are preferred because the challenge (as with most game) is to kill the animal with one shot, so it doesn't run. (Hunters consider it immoral to allow prey to run off and die unharvested.)
Most animals, including predators, are easily repelled by gunfire. Between the noise, and the pain of even a non-lethal wound, most will run away. An exception are big bears, which are so fearless that they're merely enraged by mortal wounds. Cape buffalo are regarded as highly dangerous because they are well known to charge when wounded. We've seen video of the big bulls of a herd of cape buffalo rescuing a calf from an entire pride of lions. A big cat will run if it can, but if it can't it will charge as a final act of desperation. Where a T.Rex would fit in this spectrum is unknown. Their behavior simply has not been observed. With these larger animals, safe hunting becomes a matter of applying an appropriately large and powerful projectile, and/or applying several of them rapidly enough to counter its charge. With a T.Rex, of course, this could be a serious problem. I've seen a T.Rex skull (they have one in the museum downtown) and carrying a gun big enough to bust that might be impractical. Chewing its neck off with lots of smaller fire might be a more viable approach. Small bullets would still _penetrate_ them, they wouldn't just bounce off just because the animal is too big to easily kill!
So here we have Cortez and his men (this is _before_ the famous Mexican campaign, apparently) captured by American natives and scheduled for sacrifice on the pyramid. It appears that all those human sacrifices were about appeasing the bloodthirst of the pair of T.Rexes that terrorized the continent in the day. Rather than just having their hearts cut out and being fed to the lizards, Cortez et al talk the Aztecs into letting them hunt & kill them. OK, maybe they don't have M-16s like the guys in the "Carnosaur" series, but they _do_ have flintlocks, crossbows, pointed sticks (big ones, made from trees) and swords. Maybe that's a little less uneven than squads of soldiers with full auto, but they've several guys and I'd quickly bet on them over a dinosaur. Oh, wait, there's a _cannon_, about a 4-incher. That's just the ticket for busting a Tyrannosaurus' skull! So they lay a trap, with a squad of men, cannon, pointed sticks in a ravine, and lure the first T.Rex into it, using a pretty brown girl as bait. Cortez points out that they'll NOT have time to reload, so they'll have to close the range until they can be certain of their aim. T.Rex totally ignores their volley of flintlock fire, and we see both a crossbow bolt _and_ the cannon ball _bounce_ off! Forget it. End of credibility. A crossbow bolt would defeat Cortez' torso armor, and a 4" cannon ball might penetrate the hull of a wooden ship! This would also _certainly_ get through the hide, ribcage, or skull of any animal ever to walk this planet. (Do you think a _whale_ could withstand a 4" cannon ball?) And here's T.Rex, still standing, not even bleeding. So Cortez lures it to the ravine, where it falls onto the pointed sticks, which (I guess by magic) penetrate it and kill it. Yaaay, pointed sticks!
The dinos aren't completely invulnerable to gunfire - they manage to put out an eye of the second one with a pistol. This runs it off, so it's NOT as mean as a bear or a buffalo, at least in the movies.
They kill the second dinosaur with a bomb - made from a gourd filled with gunpowder and gemstones. My money would still be on the cannon. It's engineered function is to concentrate all the gunpowder's energy in one direction - toward the target. A bomb is a much more diffused application of force. A _real_ bomb (NOT a gourd bomb) has a steel casing which contains the explosion to extremely high pressure. (Think: pipe bomb vs firecracker.) A pile of gunpowder set on fire will simply go POOF. (Trust me on that one.)