Is it possible to prevent disk replacement in a laptop so it cannot be used after theft?

Disks and RAM sticks are usually intended to be user-replaceable parts. There's really no way to conveniently secure them so that they couldn't be replaced.

You could replace the standard philips screws with tamper-proof ones, but those can still be opened with the appropriate tool or simply drilled out. You could glue the drive slot's access cover or even glue the drive to its place, but that also prevents you from replacing it if it fails. And a thief can just break the cover. You can lock it in a steel box with seven keys, and the thief can steal the entire box.

Security is always a balancing game. The more difficult you make it for someone else to use your system, the more difficult you make it for yourself. Any method to secure the system can be overriden with time and dedication.

There's one way to secure your laptop, the same you use for every other thing you own: always know where it is.

Giacomo1968's comment is very much on point. There are solutions for tracking stolen laptops. Some manufacturers even include a solution to the purchase price of the laptop; at least for a limited time. However those also are only effective for a limited time.

So taking care that your personal data doesn't get into wrong hands is more important than worrying about the hardware. Three basic things:

  1. Backup your data regularly, at least in a separate external drive, but preferably in 2 separate locations - backups can also fail. A cloud solution is again useful.
  2. Never store any critical information on the laptop drive alone, always keep an up-to-date copy on a separate USB stick, cloud storage etc. so that in case of theft (or a HW failure) it's always available for you
  3. Encrypt the drive. Even if your device is stolen, an encrypted drive is practically impossible to access.