How common is it to have a demo at a doctoral thesis defence session?
I've seen a couple of PhD defenses with demos (in engineering/computer science).
It's not common because many PhD theses don't naturally require a demo due to their subject, or because a demo would be logistically difficult (e.g. requires special equipment that can't be brought to the room where the defense will take place, or takes too long given the time allotted for the defense). Also, live demonstrations are somewhat prone to failure, and a PhD defense is not a good time for a failed demo :)
But if a major contribution of the thesis happens to be something demonstrable, and it's not too difficult logistically, then a demo can definitely enhance a defense. (If logistics are the issue, a short video of the demo can also enhance a defense.)
In computer science, a tool demo during a PhD defense is not the default case, but also not unheard of. In some CS areas such as software engineering or computer vision, a tool can be a research contribution in itself, and, therefore, lends itself to presentation at the defense.
I also have never seen a demonstration. However at PhD level there is a difference in that there will have been peer reviewed published work as evidence. This is not usually the case in Master or undergraduate thesis [in my experience].