However, the main complication is minimum size. As others have implied, larger animals have a natural advantage over smaller animals, because all of their tissues are bigger, and must naturally be tougher to hold the animal together (as well as survive the normal bumps and scrapes that animals generally encounter). This is why you can't really hunt bears or elephants or buffalo with your typical 9mm street gat that you would use against hood thugs (with moderate effectiveness, no less).
Contrary to AndreiROM's answer, humans cannot simply build guns that kill arbitrarily tough targets. Man-portable weapons have an effective upper bound on size and firepower. At some point, the weapon either becomes too heavy for a single person to carry, or the recoil becomes too great for a human to safely fire the weapon.
For instance, one of most powerful rifles in the world today is the modern .50 caliber sniper rifle, like the Barret M82. Although the M107 is intended to be a shoulder-fired alternative, the fact of the matter is that most pictures of either rifle being operated involve the use of a bipod. This tells you that the weapon is pretty close to the edge of what should be considered "man-portable". Already, the M82 creates so much recoil that a muzzle brake is essentially required for safe operation. And yet, the muzzle brake itself increases the sound exposed to the shooter to well above safe hearing levels, requiring the use of ear protection.
Most guns today are designed to kill animals, humans, or vehicles. Humans are pretty soft targets, so we can ignore those for now. Vehicles are hard targets, but they do not have good protection of vital organs, because that would make them heavier, more expensive, and difficult to maintain. Most animals which are hunted are smaller than moose. So the guns we have today are designed to kill animals that size or smaller.
What many non-hunters probably do not know is that it is easy to wound an animal without killing it. Shooting an animal from a bad angle or just grazing it has a good chance of missing vital organs. In this case, the animal has decent odds of survival, assuming it isn't tracked down and killed.
Designing a lethal gun/round is trickier than it might seem. You actually don't want a bullet to just fly through your target at high speed, because if it doesn't create a large exit wound and it doesn't hit vital organs, the target has a good chance of surviving. See this excellent article on the considerations involved.
If the animal can get big enough, its size alone will produce a thick hide which will allow it to shrug off smaller rounds. I would hazard a guess that a brontosaurus would be pretty safe from most rounds being fired in 1850, except for lucky shots to vulnerable areas. But, supposing that you had a gun which could penetrate the hide easily, there is no guarantee that the bullet could reach vital organs or inflict sufficient damage to kill the animal. Humans are not knife-proof in the sense of having a hide so thick it can stop a blade, but the majority of knife attacks are not fatal.
I agree with Nathan that if the animal has a shaped carapace which tended to deflect projectiles, then it could significantly reduce or eliminate the lethality of many rounds.
Although you did not request a plausible evolutionary pathway to such a creature, it is not inconceivable to have an environment with regular ballistic hazards, from rocks being spewed by geologically active events (volcanoes, geysers, etc.) to predators that use a kind of high-speed attack to kill targets (think perhaps a hawk-like bird that uses its beak like a spear). Also, armor against bullets would generally be effective as armor against teeth, which is why creatures like the Ankylosaurus would exist in the first place.