Probably would. Dogs are pack animals, and they release a lot of the 'love' hormones around humans they trust and rely on. Cats are colony animals, not pack, so they're oriented towards food and comfort. They'll jump ship and adopt a new owner in a heartbeat. But dogs are like humans, in valuing affection. We dogsit for friends, as we don't have a life right now that can encompass a dog of our own, and one of the dogs genuinely loves us more than the owners. It's actually quite embarrassing. Another tolerates us, but basically longs for the owner to return - other than my husband; she dotes on my husband even though he never walks or feeds her at all.
Dogs have an evolutionary urge to form close social bonds, like people. So yeah, I think dogs are loyal, because they're genetically programmed to be over years of that conveying an evolutionary advantage. Just like we are.
Doesn't mean anyone should have to be anywhere near dogs if they don't like them, far less swim with them. But if you're okay with being in a pool with little kids in swim nappies, then you've probably had more exposure to faecal matter in the water than any dog will bring.