It may appear like some dogs are happy to share their toys or treats, while others can become possessive of them. This isn’t because dogs think about the feelings of other dogs and decide it would be kind to share, it is due to the level of resource guarding found in that particular dog. Those who share toys and food with other dogs are just simply less protective of their things.
This is really helpful to remember, especially in a multi-dog household. If you have a dog who doesn’t like sharing resources, either separate when feeding/playing, or remove the resources when they’re together.
If you’re having issues with resource guarding please contact a local trainer and get help. It is a very fixable behaviour, but it’s usually exacerbated due to terrible advice from others like putting your hand in their food bowl.