Damage is reflected when hit by an attack, regardless of whether the attack deals damage. If the attacker is blinded, or the wearer is protected by a shield or invulnerability, damage will still be reflected.
Abilities that apply on-hit effects, such as Blade Waltz, will trigger Thormail.
If you have >233.3 effective armor, Thornmail will reflect more damage than you receive, assuming the attacker has 0 magic resist; if they have 30 magic resist, >333.3 armor is required.
Thornmail is a particularly effective defensive option when facing down opponents whose damage is dealt primarily through autoattacks, or against opponents that utilize on-hit healing to survive fights (such as life steal).