Can I replace my Pentium 4 CPU with this Core 2 Duo?

Socket 775 had a long life but older versions of the socket are not compatible with newer 775 socket CPUs. It made upgrading really difficult plus your using a HP branded PC which limits the CPU support even more. I can't say for certain but the likely hood of the E8500 working in your board is very bad.
 


"working", as in it still powers up....yes.
"working", as in does it meets your current performance needs...no.

Any CPU change you could make to that wouldn't be worth the 15 minutes it takes to make an online order.
It has exceeded its usable lifespan. Let it go.