The job of a heatsink is to move heat away from some component that would otherwise get too hot and dissipate that heat into the air. This means the surfaces of the heatsink needs to be open to free air. Putting anything other than the part that produces the heat onto a heatsink will decrease its effectiveness. Putting something that produces its own heat there makes it even worse. Then there is also the additional issue of whether the extra part can handle the temperature. So, the short answer it that this is not a good idea.
However, this does not meant it is guaranteed to fail. If everything isn't running at its thermal limit, then the heatsink has extra capacity, and some degradation of that capacity can be tolerated. Still, this is not something I'd do except as a last resort, and then with some careful analisys to make sure everything is OK.