Is it possible to damage the system (macOS) by installing pirated software?
I would like to ask Is it possible to damage the system by
installing pirated or cracked applications?

Damages
Physical damage?
Not impossible, but improbable.  There are viruses out there that can attack vulnerabilities in the CPU, for example.  Like the new CSME CPU Bug.  Pirated software ups those odds.
Software damage?
Of course.  Just because macOS has SIP, user roles, T2 chips, etc. doesn't mean a user who installs pirated software is immune.  If you install software as an admin, you've given permission to that software to do some nefarious things.
System Security

In Windows, the programs are installed without problems and access to
system files is simple. Any user can delete a file from the system and
damage it.

If you're referring to Windows 95, then you'd be correct.  Windows security has come a long, long way since then and Windows 10 security, TPM, secure boot as well their encryption is extremely strong.  DoD level strong.

However on Mac, it cannot touch system files, which in my opinion
makes it safe.

Ha!  That's a huge error in judgement!  A piece of malware doesn't need access to your system to encrypt your files and hold them for ransom. It also doesn't need access to your system to install a back door or a keylogger that sends all your personal info out to some nefarious server somewhere.   Installing pirated software is the quickest way to get a threat onto your computer.
Don't Install Pirated Software
There's more than enough FOSS (Free Open Source Software) out there to meet your needs.  Pirating is theft regardless of your point of view on software licensing.  When you use the software, you agree to the license.