Can fig trees endanger neighbouring buildings?
In my experience tree roots have damaged foundations. The roots penetrate the smallest cracks and if they don't open it up wider, it still allows more water to enter than what the foundation should be designed to keep out. 

When roots grow, and they will the displace dirt, and the dirt will go somewhere. At times it is the wall that give under the pressure.

You could root prune the tree by digging a trench, if there is room, cut back the roots, water proof the wall and fill the trench again.