Nuclear fragmentation in particle therapy and space radiation protection: from the standard approach to the FOOT experiment