If I give my mercenary an item that has "Chance to cast" attribute, will it work?
Yes, it will work as normal.
See the ultimate guide to mercs for more tips on mercenaries:
(2) Most other mods (Crushing Blow, Open Wounds, Chance to Cast on Striking, Faster Cast Rate, Faster Hit Recovery, Increased Attack Speed, etc.) do work for mercs.
They all should work, except the
chance to cast Valkyrie, because it is bugged. It even works buggy on the player, making spawned Valkyrie despawn, because the server doesn't find a skill point invested (or granted by another item) into Valkyrie skill on player, and Mercenaries can't have their own minions.
I hear the same stuff happens with
Spirit of Barbs, Druid's summoned creature, charged skill from
Bramble runeword, but everything else should work.