I had a mouse and keyboard connected to a PC. As it turned out, the PC was infected. I then plugged the mouse and keyboard into the Xbox because I wanted to play with the mouse and keyboard. Could there be a virus on my mouse and keyboard that's now on my Xbox?
No, something like that is not possible because there can be no virus on either the mouse or the keyboard.
so do not worry