It depends. Tea tree oil is a natural anti-fungal agent. It works for athlete's foot and sometimes toe nail fungus. If you have dandruff that is caused by a fungus, it may work on that. If you have dandruff caused for other reasons (dry skin, dermatitis, etc), it probably will not work.
Probably the best thing to do is to buy some over the counter Nizoral (used to be prescription). When my son was a baby he had horrible, horrible cradle cap. He was 2 years old and it still wouldn't go away. Tried Head and Shoulders, T-Gel. Then the doctor told me to try Sebulex (over the counter). I used it a few times, it cleared up and never came back.