Yes, unless otherwise noted
The Immunity ability makes you immune to all damage and secondary effects based on the source of your immunity. So a creature immune to fire would be immune to fire damage and all secondary effects from a fire source. A fire elemental is immune both to any fire damage and effects like the Fireworks effect of Pyrotecnics.
However, a stone golem is not immune to sanctuary
The Stone Golem immunity is more specific, and doesn't work on all forms of magic:
Immunity to Magic (Ex)
A stone golem is immune to any spell or spell-like ability that allows spell resistance. In addition, certain spells and effects function differently against the creature, as noted below.
In other words, if the spell or spell-like ability allows spell resistance, the golem is immune to it. But spells and spell-like abilities that do not allow spell resistance, like Acid Splash, Create Pit or Sanctuary, will work against the stone golem normally.
Spell Resistance no
Also, Sanctuary is a spell of the Abjuration school, and not tagged by any of the mental-affecting effects that constructs are generally immune to:
Immunity to all mind-affecting effects (charms, compulsions, morale effects, patterns, and phantasms).
Neither it is of any of the physically-affecting effects that they are also immune to:
Immunity to bleed, disease, death effects, necromancy effects, paralysis, poison, sleep effects, and stunning.
So, if you had immunity to Abjuration effects, or immunity to divine spells, or even immunity to effects that require a will save, all would apply against Sanctuary. But that's not the case for stone golems.