Yes. You can use a variable. The only requirement is that it is a string and the string must be no longer than 8 chars.
The file names I use are made up if two four digit numbers that I generate using a calculation. In my case, since I am using bytes to generate the number, I have to convert the string of numbers to a string before sending it to the SD.
char Files[5];
int Current_Long, Current_Lat;
string Infile, EXT;
In the section of code above, "Infile" is the file name that will be sent to the SD.
"Files" is a 4 member array of chars containing four numbers.
"EXT" is a string containing the extension for the file name.
The function "itoa" only works with arrays of chars. The first variable is the input variable, the second is the output variable and the "10" is the numbering system. The numbering system could be binary, HEX, Octal or decimal. In this case I used base 10.