To be exact on your question: there's no difference in internal implementation.
But as a best practice, you should be using
$this->t instead of the global
t wherever possible. If you check the function,
t is returning a new TranslateableMarkup object.
If your class says
$this->t is not defined, you can add the StringTranslationTrait to add the behavior or inject it as a dependency.
Using this trait will add t() and formatPlural() methods to the class.
These must be used for every translatable string, similar to how
procedural code must use the global functions t() and
\Drupal::translation()->formatPlural(). This allows string extractor
tools to find translatable strings.
If the class is capable of injecting services from the container, it
should inject the 'string_translation' service and assign it to
So as a best practice rule, you generally do not want to mix procedural within OOP unless completely unavoidable (e.g. native PHP functions).