NHL head coaches are relieved of their coaching duties (are fired) every year. Sometime they resign under duress (are fired), for example Mike Babcock & Joel Quenneville.
Obviously, the details of contracts are not public and would vary, but has anyone ever quit in the middle of a contract to take another head coaching job?