Wow! Not a good idea at all...
I produce 20 cubic yards plus Hot compost a year, with a pitchfork, cussing, water hose, and elbow grease. Some of that I use as a soil for the garden, some I use in my worm beds as feed and bedding. There are TOO MANY variables to try and keep the bees safe and warm using compost heat.
To maintain a steady heat, the pile will have to be turned every 2 to 3 days. You will need to have a mass of 1^3 yard minimum (!^3 meter) to retain the heat after buildup. Also the heap will produce all kinds of by-products like Ammonia, Carbon Dioxide, and Water vapor. If not properly aerated, it can produce a chemical toxic to life in general, which name I forget.
Decomposition that happens in the tree cavities is regulated by mass, nitrogen, and moisture. Thermophiles would require the mass to use as a scaffolding and nitrogen to reproduce. Wood in itself is very low in nitrogen, and most decomposition is due to mesophiles. Bees will chew away all dead and loose material, then "varnish" the walls with propolis.
I side with BlueBee and Finski. The bees produce their own heat using a similar metabolism, and you would have much better results letting them regulate their own environment.