MIDI controllers normally only connect to one app at a time. First app wins. For instance, I am able to use my Hercules DJControl Compact with both Thetis and Voicemeeter but not at the same time.
However, as you might expect, people have come up with solutions for this very obvious limitation. I don't have any specific recommendations, but a two second Google search came up with:
https://hautetechnique.com/midi/midisplit/loopMIDI, Bome MIDI Translator, and MIDI-OX all are capable of creating virtual MIDI ports and virtual MIDI cables and can be used in much the same way as virtual serial cable software to split a controller between two app's a the same time.
Note: I just have a general awareness of this stuff, I've never tried it and therefore can't offer specific guidance. However these software app's appear quite popular and have thriving online forums associated with them.