The MACRO experiment and its legacies