I'll just drop my original post here to see the Den's side of things:
Muskets saw use as early as the 1500s, so one can technically say that Age of Exploration-era firearms can fit into a D&D setting. Given staples like Wizard experiments and "technomage" gnomes, it's plausible that gunpowder weapons may exist somewhere.
Whether due to adherence to "realism and authenticity" or a deliberate desire to relegate guns to gimmick status, game mechanics for pistols, muskets, and cannons are sort of lackluster.
In many products, pistols and muskets do more damage than bows and crossbows but have shorter range increments, take longer times to load, and are exotic weapons. In Green Ronin's Freeport series of books, a gun can take anywhere from 1-3 full-round actions to reload!
One could say that in the real world, early firearms didn't gain prominence due to the superiority of a bow. The trend reversed when firearms design improved armor penetration and accuracy.
In many settings, gunpowder is either a closely guarded secret or popular only among a certain culture or nation.
Naturally, I say "who cares?!" to the adherents of "firearms are unreliable and must be worse in every way!" The idea of playing pirates and musketeers with pistols and cutlasses can be cool! For character optimizers and folk who care about weapon reliability, firearms need to have some advantage over composite bows in order to merit a feat slot.
What do you guys think? How do you incorporate firearms into D&D settings? Any recommended house rules or sourcebooks with good Age of Exploration-era gun stats?
And just another thing to throw out for fun: How about modern-era firearms?