This depends on whether a Thunderbolt 4 monitor offers multiple video input and USB downstream ports.
A monitor with a KVM switch requires multiple video inputs for the display and a USB downstream to connect a common keyboard and mouse to the active computer.
A USB hub requires a USB downstream port so the computer can send a signal to the USB peripheral via the monitor.