How can I bring my pet to the valley of dead?
I tend to lose my pets pretty early on, so this won't be a great answer. I think the best way to do this is to get a saddle and ride your Dragon. Ridden animals are affected by traps, so I think in the case of a trapdoor you both fall through, although I'm not certain.
The only other way down to the Valley is by level teleport, but I'm fairly sure that doesn't take your pet with you.
Once you're in the Valley, there are stairs leading back up to the Castle. I don't recall whether you can use the stairs to subsequently return. If you can, then you could pick up your pet by coming back upstairs, meeting up, and then walking down again.
A pet adjacent to you when you change levels (as long as the pet is not busy eating, or asleep, or unable to follow for some other reason) will always come with you, regardless of whether you're falling down a trap door, levelporting, branchporting, using stairs, quaffing a cursed potion of gain level, etc.
For the trapdoors in the castle, of course, the pet usually needs to begin on the other side of the trap to end up adjacent to you when you actually step on the trap. If this is difficult to set up, try to find a leash.
Of course, the trap doors aren't actually the only way into the valley; if you can acquire teleport control (probably with a ring), you can read a cursed scroll of teleportation and teleport to the Valley from anywhere in the Dungeons of Doom or Gehennom.