Yes, VLSM can be used with both IPv4 and IPv6. While it has been commonly associated with IPv4 due to its longer history, VLSM principles can also be applied to IPv6 networks for efficient address allocation.