Perhaps they're just a pleasing form - just like, when you think of it, why would anyone put acanthus leaves, or bouquets of roses on a gun? But somehow they're pleasing forms that have become quite normal.
Pineapples were apparently symbols of luxury, hospitality, the exotic in days gone by, so it makes some sense that they might have appeared on finer guns.
I kick myself that years ago I didn't buy an old muzzle loader that had hammers shaped like dogs; and I've seen a "green man" engraved on a gun before.