Yes you can! However, depending on the plugin you are using, it might be picky about what you put in the variable. Here are two examples of variables being used in a migration config:
A file import
media_name: 'Media name'
In the above, both
constants/uri_file established in the "source" step of the migration, and
uri_file passed as
@uri_file to the download plugin in "process" step are variables.
The documentation for the migrate_plus process plugin "merge" has another good example:
In both these example, the vars are used in arrays. That's just what the plugin expects, not something inherent to using variables.