I trained mine to allow that. It's one of those basic dog ownership things everyone with a dog should work on. Food aggression is bad enough but some day you might need to get something out of your dogs mouth and you don't want to have to worry about getting bitten.
That's a great thing to do, honestly I didn't do any training on her, she was adopted 2,5 years ago and was more or less 3 or 4 years old and she was already very docile(not with cats though)
I only adopt rescues, my first 2 dogs loved to run away and were both super food aggressive. I couldn't train it out of them. Then my most recent recent dog I got was a 1 year old GSD. I let her off leash at the park sometimes and even if there's a other dog or a squirrel she won't run off, shell generally stay near me and she will always come if I call. The other thing I love about her is 0 food aggression. There's no point to this post I just love my dog 🐕