That depends on what form factor that HP/Compaq motherboard was. If it was a proprietary form factor like MANY HP/Compaq systems were, then you can't. If it was a unit with a top mounted PSU, then you MIGHT not be able to, but you might, it just depends on what PSU form factor is supported as well.
Seeing what that case looks like on the inside, and the back, or knowing WHAT the EXACT model of the system that case came with was, are the only ways to answer that question. Knowing the exact model of the motherboard you want to put in it and the exact model of the motherboard that was in the HP case, would be the best way to know.
Usually using OEM cases is rarely a straight forward process. Occasionally they'll use a standard form factor but just as often they use something proprietary whether it's the type of front panel wiring and connections used, or the PSU, or the motherboard form factor and rear I/O configuration. Trying to use something very old with something fairly modern, sometimes, but rarely, works out, without modifications.