Yes but democratic countries try to avoid it as much as possible. Also it could be really good to avoid it in high profile cases. Just think of the reaction of Marta Stewart had been beaten up in jail. This is a extremely high profile case. A lot of Iraqies dislike Bush and if the guy that throw the shoes is beaten up it will increase his popularity. Iraq also have to show that they have started respecting human rights in their prisons. A good start is keep the high profile cases from being beaten up.
A parallel is the Swedish king that got a cake in his face. According to some old forgoten Swedish law the cake thrower could get up to seven years in prison. But the king pushed for droped charges. Because it would have diminished his popularity and increase the sympathy for the cake thrower.