I suppose it depends on how you define a hat-trick. If it is defined as taking three wickets in three consecutive balls, then taking two wickets with the last two balls of a match, followed by taking one wicket with the first ball of the next match, fulfills the definition.
If the definition is tighter than that, such that a hat-trick should only be three wickets with three consecutive balls, in the same over. Taking two wickets on balls five and six of an over, followed by a wicket on ball one of a subsequent over, should not be a hat-trick, but it is often described as such. So what definition of a hat-trick is correct, or at least accepted by cricket cognoscenti?