Yes, the MIDI input is stored in the instrument, not the program.
To allow the opposite (MIDI input targeting a specific instrument slot, “whatever might be there”), you could try using a tool such as the Duplex keyboard.
By default, it controls a single instrument. If you want to control many instruments, setting it up is a bit more involved as it’s done via configuration files (for example, the Duplex PadKontrol / Keyboard configuration is targeting 16 different instruments from a single MIDI controller)
So what’s the advantage of the midi input stored with the instrument? I can’t think of one. I’m imagining my JD800 synthesizer changing the port everytime a preset was loaded, it would be maddening.