As it turns out, the Wizards were dealing with Time magic, not dimensions, and he's from the far, far past, and she detected the anomaly from her castle already. He makes a quip about having seen demons back where he's from but the talking dogs seals the deal that this is just some sort of weird hallucination, which makes Bubblegum pause and Finn sort of surprised, but neither presses it. For like five seconds it looks like Dan might fight Finn over Peppermint Butler's presence in the room, but Jake tells him that PB's into weird stuff, which actually calms him and avoids any actual blows.
Dan steps into PB's time travel device, apparently goes smoothly, ends up in his own bed. He's convinced it's a dream, but when he wakes up he realizes his bed is coated in yellow dog hair and has bits of sticky candy everywhere, and curses Ooo. Last scene is a tiny candy kingdom 'fruit fly' popping out of a tiny portal above the bed when he's out of the room, implying that the Candy Kingdom's tech is near the end of the series.