Any cactus can be grafted onto any other cactus, and even the most unlike of them grow together. My latest graft was a Schlumbergera truncata scion on an Opuntia microdasys rootstock. This kind of graft is always successful. Why can't garden trees be grafted in a similar way, between genera?
Firstly, different genera of trees can occasionally be successfully grafted. For example, quince, genus Cydonia, may be used as a dwarfing rootstock for pear, genus Pyrus.
However, it is true to say that this is the exception rather than the rule.
In the case of plants in the family Cactaceae, I would suggest that grafting is usually successful for two main reasons:
Genetic similarity. Plants in the family Cactaceae while known to be morphologically often very different, have relatively little genetic diversity. This will increase the likelyhood of a successful graft.
Ease of aligning vascular cambium. This is required for a successful graft, and in Cacti this is quite easy to achieve since the cambium is clearly visible when you prepare the scion and stock.
It is also possible that Cacti readily form callus tissue, which would also aid in the grafting process.
Nyffeler, R., 2002, doi: 10.3732/ajb.89.2.312 Am. J. Bot. 1 February 2002 vol. 89 no. 2 312-326