I'd see this to be implemented in Lemmy itself. Hashtags are a global thing, not instance-specific, and should already be available to Lemmy via AP.
Lemmy would "just" need the ability to display a hashtag as a "community" containing posts made under that hashtag. Question is what to do with replies but given Lemmys design, they could probably simply be left out because, if it's truly on-topic, the post will likely contain the hashtag too and therefore land in the hashtag "community".
I was being a bit unclear here, what I meant was that replies mentioning a hashtag shouldn't show up as posts in its pseudo-community; only posts. Replies to a post with a hashtag would show up regardless of content.