I typically bring a big bad of M&M's on my long haul flights and they do enjoy them. More than once I've seen them dividing the bag up in plastic cups in the galley and FAs take them to the rear. On a 767, I saw a captain take some when he went to 2K for his rest. I think as long as what you bring is commercial and prepackaged (not homemade and in ziploc bag), they are welcome. If nothing else, the gesture is certainly appreciated.