Canonical performed a license review of ZFS in 2016 and concluded that it’s OK to have ZFS precompiled in the stock Ubuntu Linux kernel. Other distributions use the DKMS version of ZFS, which means that ZFS is loaded separately. All that is for the kernel modules of ZFS.
For LXD to use ZFS, first the kernel modules must be loaded by the operating system. Then, LXD should have access to the ZFS client software (ZFS tools). As @stgraber mentioned, there are several versions packaged in the snap so the user that has the LXD snap does not have to worry about the client software.
However, if you are using the DEB package of LXD, then you need to take care and install
zfsutils-linux before running
sudo lxd init. Current versions of LXD will only show ZFS as an option for a storage driver if you have