Firearms would have the same primary advantage over magic that they have over bows and arrows. They're easy to use. They require less training than a bow and less strength than either a bow or a crossbow.
There were centuries of development of gunpowder based weapons before the first crude cannons appeared. Compared to what even a middling wizard could do, these early weapons were not all that impressive. Which is assuming, of course, that gunpowder works and can be manufactured using the same techniques we use.
I do throw in a bit of steam-punk into my games, but it's really magi-tech. I've considered campaigns where guns dominate (up to a weird wild-west genre) but I'm having too much fun in my current campaign world.
Funny thing with introducing guns is that I don't have a problem with metal armor being effective against bullets. I can justify that as a little bit of adamantine added to the steel making that breastplate bulletproof. But dex based AC? Dodging fast enough to get out of the way of a bullet is even more ridiculous than dodging out of the way of an arrow.