It’s not “in Virtualmin”. Virtualmin is not your OS. Your question is “How can I upgrade Mariadb on Ubuntu 22.04?”
Virtualmin does not depend on Mariadb, so you can’t brick Virtualmin by breaking Mariadb.
But, yes, Virtualmin supports Mariadb 10.8. Whether you should upgrade a single package from third-party sources is worth putting some thought into, as it removes one of the benefits of using an OS with a long support lifecycle and makes future OS upgrades harder/riskier. Usually it is better to upgrade your whole OS when you need newer packages.
Ubuntu 24.04 has Mariadb 10.11, so upgrading your OS to Ubuntu 24.04 would be one (recommended) path to getting a newer Mariadb version. Just follow the documentation for upgrading your OS. There may be minor config tweaks needed in Virtualmin/Webmin, I don’t recall details, but I know it’s been discussed here in the forum a few times.
Another path is getting it from a third-party package repository, maybe provided by the Mariadb developers themselves. If getting it from somewhere other than the OS, you’ll need to read their documentation for how to switch. Sometimes it requires a dump/restore. You may also need to update paths in Webmin’s Mariadb/MySQL module configuration so it knows how to find your unusual Mariadb installation (paths for config files and PIDs and such might change when installing from sources other than your OS). If you search the forum, you’ll find several discussions of this question and this path.
I generally have a strong preference for sticking to OS-provided packages when that is a feasible path.
As always when doing anything dramatic: Make sure you have good Virtualmin and system backups. If I were doing a database upgrade, I would also just make a separate dump of all of my databases (though the dumps will also be in the Virtualmin backups, as that’s how Virtualmin always backs up databases, since you can’t copy the binary database data dirs across to different versions of databases and expect them to work, but dumps are resilient to version changes, and even changes between MySQL and Mariadb).