A hat-trick occurs in cricket when a bowler dismisses three batsmen with consecutive deliveries. The deliveries may be interrupted by an over bowled by another bowler from the other end of the pitch or the other team's innings, but must be three consecutive deliveries by the individual bowler. Only wickets attributed to the bowler count towards a hat-trick; run outs do not count.
Here one thing we have to remind is that, there is no official definition or law for Hat-Tricks. There are no official wordings or like that as how a Hat-Trick is achieved. It is more commonly a term used by media and others who see this an individual achievement by a player. So basically it is to be left with each person's perspective as to which one is a Hat-Trick or which one is not.
Like asked in this question one can argue over a Hat-Trick with a wide ball(or no-ball) in between.
Anyway in the same link I provided, there are some peculiar Hat-Tricks...