When one of the members of our skydiving community passed away, some of us built a contraption out of ABS pipe and fittings - complete with gate valves - and fastened it to the strut of a plane. It worked a treat for spreading his ashes. (I was flying the photo plane in formation.)
The trick - whatever you’re dropping - is to get it well outside the aircraft before letting it go. One of the jumpers I flew with a smoke generator attached to his leg didn’t get his leg far enough out the door before setting it off, and the entire cabin filled up with smoke - which fortunately dissipated quickly once he left.