Fire Pokemon can still survive in water - even Charizard! What seems to have happened here is that Gengar used Confuse Ray to throw off Houndoom's coordination so he couldn't swim properly, and therefore was unable to keep up the pursuit.