Does opening the Mac mini 2018 for cleaning void the warranty?

The iFixit Teardown shows the Mac mini 2018 is relatively easy to open.

Apple even returned to the user replaceable RAM option, thus indicating that they expect users to open the case. Unless you start digging around and removing components (other than RAM) I don't think you'll be in any danger.

As always, make sure you follow proper ESD procedures to protect the logic board & RAM from getting zapped by static electricity.