During the closing stages at Turf Moor, Williams swung out an arm as he attempted to break free from Ashley Barnes while waiting for a free kick to be delivered into the penalty area.
However, Kavanagh immediately stopped play to give the Welsh international a red card, and Gallagher has described the call as a "first-class decision".
Gallagher told Sky Sports News: "This is an absolute first-class decision by Chris Kavanagh. Many were saying: 'What is that for?!'
"When you see the replay again, it's not only a good identification, but a perfect application."
Burnley registered a 2-1 victory in the Premier League fixture in the North-West.