You need to use an wsl2 engine to make it available. However, for Hyper-V engine there is a workaround as well:
But use
sysctl -w net.ipv4.tcp_fastopen=3
however, this change is not persistent and does not survive reboot.
In case of wsl2 you need to set it in the wsl2 shell for the docker-desktop
distro as for Linux and use --sysctl net.ipv4.tcp_fastopen=3
option in the docker run
command.