Found this out when attempting to wipe my group in a heroic, then tested it several more times before posting here.
Leaving dungeon in combat makes it so that you do not get the dungeon deserter buff upon leaving, random dungeon cooldown of 15 minutes still applies though.
STEPS
1. Pull any random mob in the dungeon to get into combat.
2. Leave party.
3. Voila.