Sure. Macro A would be what we usually call a Sub-Macro (it's just a term we use, but most people know what it means).
First of all, variables are global. so any variable you set in Macro B will be available in Macro A.
But many of us who do this regularly use a different method. When you use the "Execute Macro" action, click the "gear" icon and you'll find an option called "with parameter". Put the parameter you want to pass here:

Macro A can refer to the passed parameter via %TriggerValue%, like this:
