nlike Windows Vista and 7, Windows 8 (as from build 8400) is not compatible with all models of the Pentium 4 processor.
This is due to the fact that Windows 8 requires a processor compatible with the following functions: SSE2, PAE and NX bit. All Pentium 4 are compatible with SSE2 and EAP: the problem may come from the NX bit.
First, make sure your Pentium 4 model supports the NX bit: for sockets 423 or 478 processors, then it won't work (in most cases).
For sockets 775 processors, it can be compatible. If the CPU supports NX-bit, you can install Windows 8 32-bit or 64-bit (it depends on the models!).
Also make sure that NX bit is not disabled in the BIOS (if present).