AEM does not really have "global variable" functionality. Variable scope is defined at the component level - be it Java as the case of Java Sling Models or HTL code. That is, a variable defined in 1 HTL component is not defined in another component.
If you want a value to be applicable across multiple components - I would look at storing a value in an AEM Node. THen in your components - you can code it to read that node value. If you change that node value - it will reflect across multiple components.