Beats me. Try it and tell us if it works. A machine sold with DOS is pretty clearly sold for the purpose of installing another OS on it.
What kind of Win8 license (retail, off another machine) do you have?
I see info on HP's site for Win8 on that machine, so it will likely work.