Both thorns aura and spike carapace do work. They reflect damage received by the owner of the passive / buff. They do not reflect damage the buff owner does like the Diablo II curse Iron Maiden, this would best be emulated by negative lifesteal.
They only reflect attack damage, further more it must be melee attack damage. Be aware that the damage reflected is based on the damage dealt (before armor and reductions) and is reflected as spell damage (which ignores armor reduction). I also believe it only works against enemies of the passive / buff owner.
2 units with maximum armor (their damage reduction from armor is reported at 100%), have types of attack and armor that deal 100% damage to each other, deal 100 damage melee and have 1000% damage reflection. One of them owned by an enemy of the other attacks the other. The other unit takes 1 damage (minimum damage an attack can deal before armor type reductions). The thorns from the other unit however reflect the 100 damage dealt with 1000% as spell damage. This means the enemy unit takes 1000 damage from his own attack that took only 1 damage from the other unit.
You must remember that spell damage is not always unreduced. Hero type armor defaults to a redcution to spell damage received. Divine armor defaults to a really high reduction to damage received. Some passive abilites reduce the effectiveness of spell damage, potentilly even beyond 100% reduction in which case thorned / carapaced enemies become uber lifesteal targets. Finally some enemies can be made outright immune to magic meaning that unless the thorns is known as an ultimate ability (ignores immunity) it will be ineffective. The armor bonuse added by hardened carapace will always be effective.