Since prebuilts are just regular desktop PCs, yes!
However, you’ll still want to double-check the exact specifications of your prebuilt before attempting any upgrades, and even update your BIOs to ensure those upgrades will be compatible with your system.