If I have a Justice ("Whenever a red creature or spell deals damage, Justice deals that much damage to that creature's or spell's controller.") and a Thermal Glider (which has "protection from red") in play, and my opponent attacks with some red creature (say, a Goblin Chariot; 2/2).
I can choose to block with my Thermal Glider, and its protection from red will prevent the damage and it will survive the encounter.
But will Justice's ability trigger? Did the red creature "deal damage" even though all the damage was reduced to zero?