Let's say there's a bug in a Windows TCP/IP implementation. Would WSL2 be affected by it?
Yes.
Does WSL2 use native Linux TCP/IP stack?
Also, yes.
The WSL2 network is using the native Linux TCP/IP implementation through the WSL2 kernel. That kernel is built from the upstream official Linux kernel, with relatively minor additions to optimize its performance and behavior in the WSL environment.
However, even though the native Linux stack is being used, the network interface is a virtual one, which connects to a virtual Hyper-V switch, which of course uses the Windows TCP/IP stack to connect to (usually) a physical NIC.
So by using Ubuntu on WSL2, you don't necessarily work around issues in the Windows networking implementation. Instead you actually have an additional point of failure:
And I have seen an issue arise specifically in the Hyper-V implementation (from the WSL Github), although I don't recall exactly what it was at the moment.
Side-note: There's one possible scenario that I can think of in which Ubuntu would not use the Hyper-V/Windows virtual switches. If you used a USB NIC, you could expose it directly to Ubuntu via USB/IP. Oh wait ... ;-)
Ok, so while you are technically using the Windows IP stack in that scenario, you are not connecting to the external network using either Hyper-V or the Windows NIC.
Note that this likely requires you to build your own WSL2 kernel which would include support for the USB NIC. It's doubtful that the stock WSL2 comes with that support yet (release notes don't indicate it has been added), although it has been requested as a feature.