I wouldn’t make that assumption.
Yes, some cheap USB hubs don’t include power supplies big enough to supply maximum current to all ports, but that just means you need to do your homework and get one that does.
For example a USB port that supports the basic power capabilities (not the more advanced PD specification) should be able to supply up to 500mA (2.5W) for a USB 2.0 port and up to 900mA (4.5W) for a USB 3.0 port. So if you have a 10-port USB 3 hub, it may need to supply up to 9A (45W) if all the ports are drawing maximum power. If its bundled power brick can’t supply at least that much, you may end up with unreliable power. But if its power supply is big enough, you shouldn’t have any problems.
If your hub supports higher power (via the PD spec), then it should tell you how much it can deliver to each port. Add them all up and make sure its power supply is at least that big.
For example, the USB hub I’m using (Anker AH231) consists of 10 USB3 ports. It is documented to support up to 900mA on 9 ports, with up to 2A on the 10th port, maxing out at 10A across all 10. So in order to deliver the advertised amount of power, its power supply needs to provide at least 50W (10A at 5V). Since it comes with a 60W power supply, it should be able to keep up. And I haven’t had any problems with it.
For docks (whether USB or Thunderbolt), you need to do the same math. Figure out, from the product specs, the maximum amount of power it is able to deliver. Make sure its bundled power supply can provide that much (plus a bit more for overhead and a safety margin) and make sure the devices you connect won’t try to draw more than that. Assuming the device isn’t cheap junk, you should be just fine.
This may be a bigger question than you realize. Are you talking about switching when the computers are powered off or are you talking about hot-swapping them?
You must be careful when hot swapping because some kinds of devices will need special care to prevent system crashes and corrupt data. For example:
- A storage device (hard drive or SSD) must be unmounted/ejected from a computer before it or its hub/dock is disconnected. Otherwise you risk corrupted data due to the computer not being able to flush its caches before the disconnect.
- If you have an external GPU or other advanced PCIe device connected, it is probably a bad idea to disconnect it without first shutting down the attached computer. Some devices (like eGPUs) may include a utility to let you safely disconnect it, but in the absence of such a utility, I wouldn’t try it.
On the other hand, more mundane devices like keyboard, mouse, network adapter, display, audio, etc. can probably be hot-swapped at will. Just be sure to check the manual for your hub/dock just to make sure. Consider downloading and reading the manual before you buy, so you don’t find any surprises.
As for how to swap devices, there are plenty of USB KVM switches out there. Some simply switch a set of USB ports between two computers, while some include additional connectors to switch video (typically HDMI, but possibly DVI or VGA) and analog audio. As with all things, do your homework - the least expensive model may not work good enough for your needs.
I would be far more cautious about switching Thunderbolt. If the KVM/switch isn’t explicitly designed for TB, you should assume that it won’t work. At least not as a TB switch - if you search for Thunderbolt 3 switches, you find a lot of USB-C switches (I couldn’t find any TB switches when I searched). If you use one of them, your TB3 port will only be operating as a USB port and you’ll lose any TB-specific functionality.
If you need to swap a TB dock between two computers, you might be better off avoiding a switch altogether and just get an extra TB cable and manually connect one or the other computer to the dock’s input port.