There have been many studies indicating its safety after definitive therapy, but they are all database studies like this one:Testosterone Replacement Therapy Following the Diagnosis of Prostate Cancer: Outcomes and Utilization Trends
or, small retrospective charts reviews like these:Testosterone Replacement Therapy in Patients with Prostate Cancer After Radical ProstatectomyTestosterone replacement therapy after radiation therapy
or small, single-arm prospective studies like this one:Testosterone Replacement Therapy Following Radical Prostatectomy
There was even one in men who were on active surveillance with untreated prostate cancer:Can testosterone therapy be offered to men on active surveillance for prostate cancer? Preliminary results
What we lack is a large scale randomized prospective clinical trial. In such a trial, men who have low T levels after their PC treatment would be randomized to T replacement or placebo. Until we have a definitive study like that, we can't say it's safe with certainty, although it certainly appears to be safe so far. In my experience, most urologists are willing to give it, but watch patients closely.