That is possible, though it is an undocumented advanced feature.
Main limitation is that the profile needs to be reloaded (E.G. using the "Reset the Active Profile" action) to re-parse the variable values (normally including when the profile is loaded initially, as the command list is compiled before the variables values will have been assigned).
I.E. if the variable value changes, that change will not affect the command phrase(s) until the profile is reloaded.
You'll need to have a good general understanding of variables and tokens. This topic may be of use, in addition to the official documentation:
Variables and tokens summed upThat said, if what you're looking for is to simplify editing those prefixes for multiple nearly identical commands for different applications, a simpler option could be to use prefix/suffix pairs.
A single prefix command can be used with multiple suffix commands, so you can have those dynamic command sections for the prefix command, which doesn't need to contain any actions, and use suffix commands with the name of the application you're looking to affect, which would contain the actions to perform that task.