Cosmic-ray propagation with DRAGON2: II. Nuclear interactions with the interstellar gas