How are dogs so trusting in the world we live in?

hi so today I just felt so yuck and I went for a walk to clear my head. I went to my local park and a greyhound came running over for a fuss. I chatted to the owner and she said her dog was an ex racer and when it came to retirement the previous owner tried hitting the dog over the head with a shovel. The dog survived obviously but got brain injury that affected his eye sight. The dog after being forced to race and was abused by his previous owner was so trusting and loved meeting new people. I’m sorry but if that was me I wouldn’t trust another person for a long time. I two abusive relationships and it makes it hard for me to trust me I do have male friends but if they try to touch me or hug me I flinch I only have one male friend that can actually touch me and I let him hug me but it took a long time to get there. How’s are dogs so trusting of people after being abused in the past? It’s a really nice thing i just wish I was like that.