It must be a bit of a regional thing, I guess? (And the couple had just moved from another state.) This is definitely done around here. I don't think I would do it with a sandwich, but I've opened cracker boxes for my kids, and I've absolutely chugged some juice when I was pregnant and so thirsty and waiting in line for over ten minutes. Just close it back up and give them the package to scan.
I do generally bring snacks for my kids when we go out, but if I gave them something like a granola bar in a grocery store, how would the store then know that I had brought it with me and hadn't actually stolen it? I'd sooner give them something from a new package and then make a point of paying for the open package.