Flags are one way, so you can't have a "two-way flagging".
In Drupal 8/9, a flag always has a target entity.
So, if user A flags user B and user B flags user A, you have two flags:
- User A's flag of User B
- User B's flag of User A
I can't think of a good way to do this in Views without custom code.
An alternative would be something like the Friend Flag module, which implements "friending" functionality (or Tinder mutual-swipe-to-match functionality).
Having implemented functionality like this before in Drupal 7, in Drupal 8/9, I would consider writing code in the
_flagging_insert() hook that checks when a user flags another user and determines whether the flagged user has flagged the flagging user. If so, create an entity (could be a node with entity references to both users or a custom entity if you want to get fancy) of type Friend or Match or whatever, and then sort the matches that way in Views. Of course, if users can unflag each other and break the match, you have to add code to support that case, too.