Is it safe to spray herbicide on the bark of a tree if you don't get it on the leaves?
To answer your question directly, it depends entirely on the type of tree and the type of herbicide. It might be okay, but it might not be. It is possible to kill a tree with herbicides, and it is possible to kill poison ivy on its own with certain herbicides without killing certain trees. 

Unless you're prepared to be absolutely certain that the type of herbicide you're using isn't going to harm a tree you care about, it's probably a safe bet to skip it. There's nothing that a pick axe + hoe + gloves can't solve. Rip the suckers out!