Yeah that is called "Intelligent Disobience". A must for a Guide Dog. They have to know to disobey a command when that command will lead to the handler being harmed. For example a handler telling the dog to "forward" to cross a street when the dog sees a speeding car coming. They learn to then disobey the command and in fact push their handler back with their side.
Nicole