You wont be able to put a Core 2 duo or an i3 in place of your pentium 4.
Not strictly true. The i3 certainly won't, but there's a very slim possibility that the Core2Duo might, it all depends on the motherboard and bios version.
The last of the Pentium 4's was the Prescott and had different versions which ran on the existing socket478 and the newer LGA775, the latter of which the Core2Duo ran on.
It's highly unlikely you would have a Core2Duo board and only be running a P4 on it. But I've got to ask, what is the make and model of your current motherboard?