The closest thing to what you’re talking about is grafting, but that’s a specific thing that only works on certain species and I don’t think can “glue” two entire halves of a tree back together, maybe just a branch at the most if you’re very careful and lucky
It’s why if you plant a seed from a random apple from the supermarket, you’re very probably not going to get a tree that produces that apple. Most commerical fruit trees (including ones from your local garden centre) tend to have a bottom half that’s hardy and resistant, and then a top half which was “glued” on that actually provides the fruit you want. The bottom half controls the genetic material in the seed, but the top half controls what the fruit will look like.
On the other hand, you can totally glue a snapped cactus back together, provided it hasn’t been too long and the two halves aren’t too damaged.