At work, I have a Dell Precision compact Desktop. At one point, I checked whether I could upgrade the CPU to Raptor Lake. Someone tried it and found that the machine wouldn't boot with the new CPU, because Dell changed the motherboard (probably to provide more power) and the BIOS is coded not to allow Raptor Lake CPUs on the older boards.
We had already maxed out the RAM at 64 GB (it has only two SO-DIMM slots), so the only way to upgrade that would be to swap it out for 96 GB. Luckily, 64 GB is still plenty for me.
Finally, they do have two M.2 slots (it came with one populated, one empty), which was lucky. Also, a spare SATA connector.