Is it good to route PCB tracks under a heatsink?
A heat sink is a piece of metal. If the solder mask on a PCB track is
  broken, it may be dangerous, right?


If in doubt, use an insulating spacer: -



For heatsinks like these: -



I use small fibre washers like these over the solderable legs: -