Multi-Seat single-desktop Linux
In Linux, there are many ways to achieve this kind of setup.
One way is to setup a multi-seat environment. In this kind of environment you can restrict multiple input devices to separate desktops. One 'seat' would have your controller, a second 'seat' would have your mouse. You can find instructions over at the Arch Wiki or at the multi-seat config section of Wikibooks.
Fedora added multi-seat support a while ago and has more user-friendly configuration than Arch (where you have to manually edit a large number of config files). If you just want to do a basic multi-seat setup, then you should go with that. However, a basic setup doesn't support using just a single video device.
Thus, having multiple video cards for your machine makes this kind of setup much easier to achieve. If you have an intel processor or AMD APU (the G-series Ryzen), these have an integrated gpu, which you can use for your second, non-gaming monitor. regular Ryzen and HEDT CPUs do not have an integrated GPU so I would recommend getting a cheap second video card and run the second monitor off that. Having a second keyboard also makes running this type of configuration much easier.
Since a game can/should only grab control of one of these desktops/seats, you should be able to mouse on one monitor and use the controller on another. However, if your game bypasses the windowing system and talks more directly to the hardware, this may not work with such a game.
On windows, you will need a paid program solution to do the same thing. They do exist, e.g. ASTER, or using the MultiPoint Server on the Server version of the windows operating system. (Which is probably not the version of windows you currently have). It's quite a bit more expensive than a simple desktop solution though, marketed to corporate environments.
Virtual machines
You could run multiple virtual machines using software like KVM or VMWare. The base machine can be any OS for this. You can then attach one device to one VM, and one to the other, then display each on a separate monitor. Or, if you want to do things like streaming, you would want to run one desktop on the host OS, and one on the virtual machine, giving the host OS access to the VM display.
This is a more rigorous and complex, but more isolated solution (likely to work with all games) than using multi-seat.
You will also need GPU passthrough to run anything graphically demanding at near-full framerate. Here's an example guide for KVM. The exact instructions will vary based on your hardware and VM software chosen. Setting this up is usually the most complicated part of a VM setup.