It all uses the ActivityPub protocol, so interoperability depends on what end points are used. In this case, favorites on Mastodon and upvotes on Lemmy use the same one as far as I understand it, so they are compatible. If you see a post from a Mastodon user on Lemmy and upvote it, it should translate to a favorite on their end.