MariaDB is comparable to MySQL 5.5 You can't upgrade from 5.5 to 8.0 without going through 5.6 and 5.7, and of course if your dbs use any features specific to MariaDB, those will not upgrade to any version of MySQL.
So I would think the best plan would be ...
1 take a complete mysqldump of the 10.1.9 dbs
2 on another machine install 5.6, ensure it's working, import the mysq;dump, ensure the data has come through correctly, fix any problems
3 take a dump of that, repeat step 2 for 5.7
4 take a dump from 5.7
5. follow an upgrade path as documented starting in
https://dev.mysql.com/doc/refman/8.0/en/upgrading.html
You'll need to reconstruct data for which you don't have backups.