How big is that hole? I would not want to plug any hole that is big enough to compromise the strength of the holding wood that supports the rest of the tree. If you plug it, and the tree fails, look for your involvement in a lawsuit. Also, explain to the owner that the cavity may still continue rotting out due to invasive pathogens getting into the foam or whatever you put in there. I would have the owner sign off on a waiver that acknowledges that the tree may still fail and that he/she will not hold you responsible for the same. I would evaluate the structural strength of the tree and then, if the situation called for it, recommend its removal to eliminate the chance of its failure. It's a litigious world out there. CYA.