My view on this would be it's risky because any environments for a project should ideally all match the same core versions of CMS, PHP version (at minimum same major version) and whatever database engine. If you use a different database engine on one environment compared to another you no longer have a consistent testing environment path e.g. development, staging, production.
While MariaDB is intended to be a "drop in" replacement, it isn't a 1:1 match, for example see: https://mariadb.com/kb/en/mariadb-vs-mysql-compatibility/. Whether or not any of these incompatibilities would be a problem for you, you'd have to review it.
You are also potentially opening up yourself for headaches with harder debugging if things don't work. For example, what if a DB query does not consistently return the expected result across both MariaDB and MySQL? What if it worked under MariaDB and then behaved differently under MySQL, granted in a lot of cases this probably wouldn't happen and possibly was more likely in older versions, but it's the same principle of even doing something like MySQL 5.7 on your development environment but then using MySQL 8.0 on production. You can't accurately test your app with confidence now, as there's a major version difference between the environments.
Stick to one consistent database engine and major version across all environments, otherwise you are potentially putting yourself in a position that could come back to bite you would be my take. As developers we deal with variables a lot. This is probably one variable you want as a constant no matter what.