Is there a way to make a form on xwiki that the data goes to the mariadb database?
Yes, see the XWiki data model at Data Model (XWiki.org)