No, there are limited conditionals you can use that are mostly for looking at what the target is [friend, party, raid, or enemy], status of the target [exists, alive, or dead], or various checks against the status of the player [combat, mounted, flying, stealth, swimming, etc.].
They are intentionally limited to avoid removal of decision making from the player.
There is a UI and macros section of the forums with information about, you guessed it, WoW UI and macros.
https://us.forums.blizzard.com/en/wow/c/guides/ui-macro
https://us.forums.blizzard.com/en/wow/t/macros-essential-information/21139