A prison governor from Wigan was in a relationship with the boss of a drug-dealing gang who went by the name of a character from hit US crime drama Breaking Bad, a court has heard.