One can testify as to what they heard someone say. That isn’t hearsay. It’s not direct proof, but it can be considered circumstantial evidence.
If an out-of-court statement by a person who isn’t a party to the action is presented as evidence of the truth of the matter asserted, it is inadmissible under the hearsay rule. However, there are many exceptions to the rule. Testimony about out-of-court statements made by President Trump are admissible in a case in which he is a party, because he is available to testify.