Unless you enable mouse broadcasting (repeater), only hotkeys for Keymaps will execute.

So, you could make a Keymap.
Use the desired mouse button as the hotkey to activate.
Choose all windows (or the targets of your choice).
And have that same mouse button as the output to all windows (or the chosen clients).