For containers, it’s not relevant as it just needs to happen once per filesystem, so the regular fstrim from the host will take care of it.
For VMs, usually you’d just want the VM itself to run fstrim on schedule inside of the VM.
It’s usually considered bad practice to map and mount a VM’s disk on the host as an untrusted guest could have altered the VM’s disk to exploit a kernel/filesystem bug when mounted on the host.