it's how "rocket stove" works: https://en.wikipedia.org/wiki/Rocket_stove
Since you burn the wood really fast, you need to delay that heat release. That's where sand comes in as a cheap and good enough material. There are also systems that heat water and store it in a tank, which also make sense if you want hot water in your house too.