It's not up to them to have to share, yes it would have been kind of them but they don't have to share their food. It's up to you to explain to your son to ask politely if he wants his own and up to you if you will allow it.
They are still in the ‘me’ stage. Don’t expect them to share willingly. It is very disheartening to see this for a 2 year old but he gets that from adults. Just go in and give him what he needs. (As soon as you see this starting to happen) Also, if you make this known, the other kids will we that you are taking care of your child and it might prompt parents to teach about sharing (if they want)
I would buy him his own cake and give it to him in front of them then make sure they don’t get any