Free food from the grocery store? Yes, it happens. Not so much as it used to, since lawsuits and laws governing food distribution are more common, but you can still ask the produce department for trimmings "for your chickens" or rabbits or whatever. No, the trimmings are not gross or dirty. Not all of it will be edible, of course; that's why they throw it out. You will be surprised at how much of it is perfectly good food, though.
Smaller stores are more inclined to give away produce trimmings than bigger ones, and big stores may have far too much produce for you to eat (raise a hog!) but it never hurts to ask anywhere.
The produce is as safe as any other produce. Just think: One moment it's in the grocery bin and the next it's in the throwaway box. It became inedible in 2 seconds?
Other bare bones or extreme ideas here:
My Story: Bare Bones Budgeting