There's no reason why that (using a class compliant MIDI USB device) would not just work out of the box. I have more than a dozen MIDI/USB devices in front of me, and they all work on a plug-n-play basis with my Linux systems. Some of them actually a little better on Linux than on macOS.
What actual problems were you facing?