They are not the same thing, even though players use the words interchangeably.
Glitch: in video games, a glitch is a programming error that produces behaviour the developers never intended — misdrawn graphics, broken collision detection, freezes, crashes, sound problems, and so on. Some glitches can corrupt save data.
Bug: a software bug is a flaw or fault in a program that stops it behaving as designed, usually producing an incorrect or unexpected result. Most come from human mistakes in source code or design; a smaller number come from compilers generating bad code.
In MMOs: a glitch is a programming mistake — walking through walls, for instance. A bug is something a player can exploit to gain resources or make the game easier.
In browser and Flash games: glitches cover out-of-bounds movement, clipping through walls and graphical errors. Everything else gets called a bug.