In order to mix the cocoa powder in water/milk, is it a good idea to put the cocoa powder in the milk while heating it?
No, it is not a good idea at all. It will be worse, not better. What you are missing here is that cocoa powder does not dissolve at all, never, it just disperses in water (or milk). So there is no reason why methods for dissolving stuff would work with cocoa powder. You will need to use a method created for colloid-producing powders like cocoa powder, which is mostly starch with fat. 

This is why the answers to the other question recommend the slurry method. When you are dispersing an absorptive powder like starch, you always run a risk of clumping, and the slurry is designed to work around that problem. But starch also thickens much more under heat, so if you were to not just forego the slurry, but simply drop the cocoa powder into hot water, this would be the worst choice possible, leading to instant unbreakable clumps. The slurry method wouldn't work with hot water either, you'll get clumps before you have created the slurry. 

So, the short answer is: if you try it, it won't "dissolve automatically", it will produce an ugly undrinkable mixture of clumps.