Thanks for posting your question in the Microsoft Q&A forum.
You cannot use variables directly in Azure DevOps work items and comments. However, variables can be utilized programmatically through APIs or tools like Power Automate, rather than within the Team Configuration Templates themselves.
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful