You need a Raven Ridge Pro chip in order for ECC to work, but if you're using a regular Ryzen, ECC UDIMMs will work assuming:
a) the motherboard has the extra traces available
b) the BIOS supports it
All of the ASRock AM4 boards list ECC support with regular Ryzen chips and it's been this way since release (although there were a few hiccups with implementation in the first couple of months); I dare say there are other boards from other vendors that support ECC also but only ASRock seems to make a big thing of making support for it as universal as possible. The ECC gubbins in the Ryzen memory controller isn't disabled on the consumer line like they are on chips from some rival CPU manufacturers.