Question: So let’s say, I get a USB hub, and I plug it into a hard drive for example (as in, I plug the USB cable that typically goes in a PC, into a hard drive) and then I plug for example two PCs into it (as in, I plug it into the part where there are multiple USB slots), can the two PCs both read and write data to it?
Answer: No. USB by design can only have a single host (one PC).
What you can get is a kind of “switch”, often combined with a USB hub. Then you can connect two PCs to it and manually switch between them. But only one PC can be the USB host at a time.
If you want to share a harddisk between two PCs, then there are other ways to do that (e.g. NAS = network attached storage).