Change the legend in highcharts heatmap to show instead of a color bar, a set of fixed icons with hide and show on click

Yes, it is possible with Highcharts. You need to only use data-classes in color-axis settings.

  colorAxis: {
    dataClasses: [{
      from: 0,
      to: 50
    }, {
      ...
    }, {
      ...
    }],
    ...
  }

Live demo: https://jsfiddle.net/BlackLabel/vk0t7g6n/

API Reference: https://api.highcharts.com/highcharts/colorAxis

Docs: https://www.highcharts.com/docs/maps/color-axis