You don't even have to subcribe to the other community to comment on it, you just need to "arrive" at that community/post through your instance. example, I 'm on lemmy.ml and not subscribed to lemmy.world, but comment here. I actually got here from browsing 'All' from lemmy.ml so I was already within my instance.
The other method would be to go to your home instance, I'm using lemmy.ml in my case, go to the search and search for either the instance or user you want. Instances start with ! and users start with @. So either [email protected] or @[email protected], then you can click through and you'll be able to comment on it from your instance and it will have an instance link. In this case, this post through lemmy.ml is url https://lemmy.ml/post/1185740