There is sort of the trouble that, if something counts or doesn't count as an attack for invisibility or sanctuary, the same is true for hex.
Thus, if fireball breaks invisibility because it is an attack, it also adds hex's damage. Magic missile does the same, but since it's classified as an instantaneous multi-target spell, it only procs once regardless of the number of missiles (similar to why, raw, you only roll one d4 and use it for all missiles).
Grappling a target would also allow the extra d6 of damage. It is described as a special melee attack, and it does not use an attack roll, so it's kind of wonky.