Asrock released a bios compatible with 5 series for only 1 of their motherboards. For other x370's you'll need an unofficial bios, so yes it's possible but it comes with trade offs, for example you might lose NVME support.
For more information look here: https://www.hardwaretimes.com/amds-ryzen-5000-cpus-can-now-be-run-on-certain-x370-boards-unofficially/