When two Windows computers are in the same domain, they plainly and simply can't have the same hostname. This is not allowed.
If instead they are in a workgroup, or in different domains, you could name them with the same name, but then they would start throwing errors as soon as they locate each other; however, if they are in different IP subnets, there are no ways for them to discover this, so they would happily keep using the same hostname.
Now, about all the other computers trying to reach them. Mapping a hostname to an IP address is done by DNS; thus, even if you had two servers with the same name, the one you actually connect to would be the one registered in the DNS, and the other one would simply be never used. Unless you have duplicate DNS entries; in this case, you'll have a 50% chance of connecting to each server.