It is not safe to remove those files - and as a general rule, any file - from MySQL data directories. Now assuming /var/tmp is not your data directory (by default: /var/lib/mysql), it could be an option, bearing in mind they'ld come back eventually. Better options would include expanding your filesystem, migrating to some larger server, or figuring out how to shard your dataset, ... Good luck.
– SYNMay 15 at 15:59

What were you in the middle of doing? Perhaps an ALTER TABLE? And let's see SHOW CREATE TABLE. (A .MAD file is data for Aria; #sql... is a temp table.)
– Rick JamesMay 16 at 1:34

It was a select but with a couple of join in large tables.
– GuillermoMay 17 at 11:46

Tell whomever wrote the query in question about the limits you put in place to preserve availability. Have a cost benefit discussion of writing more efficient queries versus throwing memory and storage at the problem.

That file is a temporary table that MariaDB wrote to disk because it was too large to keep in memory. If you've stopped the database, then the query which caused the table to be created is no longer running, so it is safe to delete the file. But you also need to investigate why that file was created and fix the underlying problem, or it will happen again.