How much of the energy from 1 megaton H Bomb explosion could we capture to do useful work?
I will give you an analogy.
Molotov bombs are made by filling a plastic bottle with gasoline, attaching a wick ingeniously, lighting it and throwing it on a target, usually a car or a policeman controlling a demonstration.
Now there are a number of BTUs of energy in this bottle of gasoline. I can ask paraphrasing you
Could we put these Molotov s to better use by exploding them in a controlled way and capturing the energy they produce?
You know the answer. It is the car engine. Controlled fusion research is trying to create the corresponding "car engine" to utilize the energy in the H bomb.
You could not control gasoline explosion in a better way than in a car engine. People would laugh if one proposed to explode a barrel of gasoline and devise a system to use the energy, no?
The same is true for fusion, it has to be incremental.
Ponder on dynamite, or nitroglycerin or a number of other explosives, which are not used for energy production because the explosions cannot be incrementally useful and safe.
During the 1970s, the Los Alamos National Laboratory carried out the PACER project, to explore the use of thermonuclear explosions as a way of generating electrical power and breeding nuclear materials. The general layout of the initially proposed fusion power plant can be seen in the following illustration:
The system parameters were under exploration, but one of the ideas was to explode about 800 50 kT thermonuclear devices per year. As the conversion efficiency was expected to be about 30%, the generated electrical power would have been
$\displaystyle 0.3 \cdot 800 \cdot 50\,{\rm kT \cdot yr^{-1}}\frac{4.2 \cdot 10^{12}\,{\rm J \cdot kT^{-1}}}{3.15 \cdot 10^7\,{\rm s \cdot yr^{-1}}} \approx 1.6\,{\rm GW}$,
about 80% of the nominal power, because that was the assumed capacity factor.
Heat loss wasn't much of a problem because of scaling properties. As the thermal conductivity of rock salt is about $10\,{\rm W \cdot m^{-1} \cdot K^{-1}}$, assuming a crudely simplified geometry consisting of a flat plate of about $1\,{\rm km^2}$ with $ 100\,{\rm m}$ of thickness and the whole $500\,{\rm K}$ thermal gradient applied, the resulting thermal flux is about
$\displaystyle 10\,{\rm W \cdot m^{-1} \cdot K^{-1}} \cdot \frac{10^6\,{\rm m^2}}{100\,{\rm m^{-1}}}500\,{\rm K} = 50\,{\rm MW}$,
less than 1% of the thermal power.
The technical limiting factors were the relatively low temperature achievable inside a rock salt cavity and the large cavity sizes required to avoid contact of the walls with the unmixed fireball.
Obviously, there were also safety and public perception problems.
See page 8 of this magazine for an overview and LA-5764-MS for the details (warning: 22 MB PDF file).