In the game of cricket, if one bowler gets two wickets with the last two balls of one over, then in their next over bowl a maiden, and then in their third over take a wicket with the very first ball, does this count as a hat-trick?
No, a hat trick is a wicket with each of three consecutive balls by the bowler1. They can be split across overs, or even across innings in a two innings match, but it has to be three consecutive balls.
For avoidance of doubt, there is no definition within the Laws of Cricket (or even any playing conditions in common use that I'm aware of) for exactly what a "hat trick" consists of (see various other questions on this site for examples) - but I don't think you'd find much support anywhere for trying to claim a hat trick of this form.
 From Wikipedia: "A hat-trick occurs in cricket when a bowler dismisses three batsmen with consecutive deliveries."