In my opinion, the favored enemy bonuses apply because the ranger knows (for instance) how to act against them in combat--how to anticipate their moves. If the ranger, for whatever reason, doesn't realize that she's fighting an "evil outsider" then she shouldn't get the bonuses. If a dragon is disguised, it makes no sense that the ranger would fight as though she were facing a dragon unless she saw through the disguise (knowledge skills, magic, qualified guess, etc...)