Most people I know do ask is it ok for her to have whatever it is, DD1 now at 3 she just grabs it anyway but yes it did drive me nuts when people didn't ask.
Esp junk food. Or when she wasn't even on solids yet and MIL would give her tatses of things.
I always ask, you don't know what allergys kids may have or for example one of the mums in my mums group has changed her kids diets, gluten free, avoiding certain additives etc so you can't just pass something over.