In theory you could do it. But there is a big BUT ... and maybe more than one.
RAID 1 is Mirroring and its only potential benefit is read performance. You're going to be hard pressed to get any noticeable improvement in read performance using SSDs in that configuration. It may have been beneficial with traditional hard drives but not much with SSDs.
Second, there is software RAID and there is hardware RAID. You could create a software RAID 1 using just macOS but then you have to use 2 Thunderbolt ports or 2 USB-C ports and you are subject to the risk that it's only based on a soft configuration. Alternatively , you could buy an external hardware RAID enclosure but then you're back to the question of whether or not you're even going to see any improvement in read performace.
OTOH, if you are trying to achieve a sort of fall/over or failsafe backup via RAID 1, it is not backup and it is not going to give you the protection you are seeking.