Hi Marty:
Hmm, please let me be as blunt as possible regarding your question: Do not drill, tap, or hammer anything metal into trees. This means no nails, screws, staples, etc.
Your best bet is to affix your bird house, or bat house, to a wooden or metal pole, post, or sign. Try using bungee cords or ratchet straps if the aforementioned isn't a viable option.