Yes, the built in upgrader goes back to very old versions, so it should be possible.
Ensure you have a good backup of your current database, ost-config.php and webserver config files, and attachment files (if stored on a filesystem) first.
Then follow the steps here: https://docs.osticket.com/en/latest/Getting%20Started/Upgrade%20and%20Migration.html
The version of PHP will need to be upgraded also.
For such a big jump it might be easier to setup a new server with the latest OS, PHP (stick to 8.0.x for the moment) and install the official MySQL packages rather than MariaDB.
Then bring over your backup files, import your database, place the latest osTicket code (plus plugins) from osTicket download site in place, plus your ost-config.php file + web server config and you should then be prompted to run the upgrader process via the GUI on your first login.