Yes you can, however:
- You'd essentially be building an entire PC as you would have disassemble and reassemble everything.
- You'll want to get familiar with parts so you're sure everything you're swapping out or keeping is compatible.
- Learn about motherboard form factors and identify yours (ATX, micro ATX, etc.). The case likely won't support a different size.
- The OEM version of windows is actually tied to the motherboard, so if you're using that you would need to fork over $80 - $200+ to buy a new version of windows.