You can't give a random, easily replaceable peasant the ability to cast fireball or 3000 years of elven archery. You can give them a musket and point them in a direction for massed fire.
Sure, but then you have to explain why warfare progressed to using peasants instead of knights, gentry, nobles etc.
In real history that came about as a result of crossbows and, eventually, firearms, but real history didn't have better alternatives.
And as Ruin noted, thats assuming warfare even resembled the medieval period in the first place. I personally think it would have, but even that would still have negated the concept of a firearm taking hold just because the context would be so different for what war is like, even if it'd otherwise resemble real life.