I have this load center on the outside wall of my house. It was added for a hot tub that we no longer use. Can I run electricity from this box to a treehouse I just built?
If this tree-house involves children, I suggest you go another way entirely.
Make it an experiment/exposition in off-grid solar technologies. Use the most common voltage for smaller off-grid systems: 12V DC. There's a lot of exciting stuff going on in this field. It is highly accessible to children. It engages them in STEM. And unlike many "STEM projects, childrens' version", you get to work in the real magilla, with the same hardware the pros use. The same design issues arise, and he gets direct field experience with them. So those skills apply directly to the solar/off-grid field.
See? This suddenly becomes worlds safer, and a whole bunch of Code and permitting issues just disappear!
(well not quite. Code does have a thing or two to say about low voltage power systems. But violating Code in this area isn't going to get anyone electrocuted and probably won't burn your tree down.)
If the system needs help, you could certainly add a 12V battery charger fed from 120V. But you'd have flexibility to put that in a safe, code legal location.
Not without getting plans OK'ed by your city. I have never seen a tree get power (OKed by the city) and really not sure what the requirements would be. I would guess that this would widely vary.
Step 1 - talk to a local inspector and ask them if it is OK.
Step 2 - If it is OK you need to bury wire, get wired protected up tree, and then follow all electrical guidelines in treehouse as it is a house.
Step 2a - If inspector seems hesitant or if you want an easier route. Run your hot tub line over to under the treehouse and install an outdoor box. Make sure it has a cover. From there just run an extension cord if someone wants to watch TV in the treehouse. This is far safer, especially if kids are involved, than having live electric in tree. I just know the dumb crap my friends and I did in our tree house.