XDG is a systemd standard that's not universally used across Linux distributions. It's most definitely not used in other UNIXy systems like FreeBSD and MacOS. XDG, like systemd, likes to believe it's universal but it's not.
> XDG, like systemd, likes to believe it's universal but it's not.
In XDG's favour, we can say that it is just a written convention that people are free to follow or not on a per-program and per-user basis. It is not a cancerous growth that tries to borg the whole system.
Practically universal. Even if there's a Linux distro going out of it's way not to set them, many tools, including big ones, support it anyway (also on non-Linux Unices). In practice I've never encountered users with a distro that didn't have these variables set.
I don't have XDG environment variables set in OpenWRT or ASUSWRT, the two Linux distros I run on personal equipment in my house. Also not set on my installs of FreeBSD.
XDG is a freedesktop standard that's been adopted by systemd, Wayland, and other important projects. It's absolutely no skin off your nose to adopt it, and beneficial to you and your users if you do.