Any form of testosterone can cause hair loss. However, it depends on genetic predispositions. If you are genetically predisposed to male pattern baldness, the use of testosterone can speed up the loss of hair. You were going to lose your hair anyway, but it may not be accelerated. If you are not predisposed to male pattern baldness, hair loss is impossible.

They do make drugs classified as 5-alpha reductase inhibitors, Finasteride being the most well known, that block the process that causes hair loss. The process is testosterone is reduced to dihydrotestosterone (DHT) due to it being metabolized by the 5-alpha reductase enzyme. Inhibitors block this process. However, they are also very unfriendly when it comes to side effects, and are not something I often recommend.