Of the two, the Pentium D is much better.
Still, it is several generations out of date and extremely slow by current standards.
Even a budget Athlon II x2 could easily outperform it...
the pentium D is your safest option, the pentium 4 has one core while the D has two...i have a Pentium D 915 and its quite a machine for my brotherc craving for games
If you're playing older games both are ok, but the Pentium D is what you want to be using (you won't even need house heating during winter either ). For newer games you're pushing your luck trying to get good performance out of either. What are you intending to play?