The Pentium D would be better for most things because it has two dies on one processor (like two brains). For gaming, the P4 might be better. Depends on what you do. Personally I wouldn't get either.
The Core Duo 2s are out and the AMD x2s are hella cheap now.
Well, it all depends on the type of motherboard you have. You would need to check to see if your motherboard is Pentium D compatible. If you're currently running an older motherboard that is Pentium 4 compatiable, it may not be Pentium D compatiable.
But, if your MOBO is compatiable, i'd go with the pentium D.