If you were talking about a smokeless powder gun, I would say don't do it.
As your talking about a black powder gun, there should be no problem with the barrel/breech plug however the lock can be considered "toast". (I know, bad pun).
Smokeless powder guns often use special alloy steels in their barrels, frames, bolts and cylinders and these steels are heat treated to bring out the high strengths required to deal with the high pressures (over 50,000 PSI pressures in some guns)smokeless powder can create. Being in a fire would anneal these steels making the gun dangerous to shoot.
On the other hand, black powder guns barrels and breechplugs are made from non hardening steels and are not heat treated. In other words, they are similar to what came out of the fire.
The bore may be in rather bad shape due to the heat and oxidation from the fire so this would have to be considered before reusing the barrel.
If you do decide to re use the barrel, it is a good idea to proof test it first.
The springs, tumbler, sear, frizzen (on a flintlock) and often the lockplate on black powder guns are heat treated and the fire would anneal them.
It may be possible to re heat treat these parts however without knowing the type of steel they are made from, this can be difficult to do. Also, the springs will be annealed while they are in the "installed" condition. Without bending them to their old "free state" shape before re heat treating them, they will not operate properly.
It is easier to just get a new lock and know that it is good.