It is toxic for dogs if used in full concentration. Even for humans, you need to be careful, but effectiveness must outweigh risks.
Almost twenty years ago, I used a Melaleuca shampoo for dogs. I had no problems with it. Since then I used Jerob Cocoa Butter and Mink Oil shampoo, which was great for dry skin, but now I use Isle of Dogs shampoo #10. If I was treating for therapeutic skin issues, I'd probably use #12. It's expensive, but I buy the liter size, which lasts a very long time. You can also try using a small amount of extra virgin coconut oil on the hair or a little bit by mouth.
Tea Tree Oil: Great for Your Cuts But Use with Caution on Pets