Hat Trick is a term from cricket and means three wickets taken on successive balls bowled by a given bowler. They need not be in the same over. Showing keen understanding of various principles, wickets on four consecutive balls is called a double hat trick. It originated in 1858 when a cricket player took three wickets with consecutive balls and was given a new hat by his club as a reward.
The term has been usurped into other contexts. If someone scores three goals in a soccer game they are said to have scored a hat trick, even if there were intervening goals scored by other plays. <fx> shrugs </fx>
AmericanCulturalAssumption CanadianCulturalAssumption
In North America, "hat trick" is usually associated with hockey (ice hockey in particular); though it is often used in soccer as well. (Hat tricks in hockey are far more common). In the context of hockey, any combination of goals/assists (an assist is a play which leads directly to a goal) which adds up to three is considered a hat trick. No need for them to be consecutive, or scored against the same goalkeeper.
In ice hockey, assists don't count -- a single player must score three goals in a game. If the player scores three consecutive goals, with no player on either team scoring an intervening goal between his first and third goal, it is called a "natural hat trick". It is traditional for the fans to throw their hats out on the ice when a player scores a hat trick.