This AddOn allows you to use /click PetSpecialAttackButton in macros to use your current pet's special ability. It will probably work with Stampede.
It can also update a macro's icon to show your current pet's special ability, just set your macro's name at the top of core.lua. The icon doesn't always update properly when you summon a pet for the first time, so you can use /psab_update or /psabu to manually trigger an icon update.
It works in all locales, but the pet family names may be incorrect for Traditional Chinese (Taiwan), Portuguese (Portugual) and Spanish (Spain) because Wowhead is only available in Simplified Chinese (China), Brazilian Portguese and Mexican Spanish respectively.
You can view the source code of this AddOn on GitHub.
Thanks to Tybudd for posting this thread on the official UI and Macro forum, which inspired me to write this AddOn.