Is there an sample to test L4S feature?
There is not a specific Xcode project sample to test out L4S, but as you have mentioned on iOS there is a Developer setting for this feature in HTTP/3 and QUIC. On macOS there is a defaults write that can enable L4S:
% default write -g network_enable_l4s -bool true
% default read network_enable_l4s
There is also tools, guides, and a test server setup on the WWDC video page for Reduce networking delays for a more responsive app.
One thing that is important about L4S testing is that you will need to have L4S compatible hardward to ensure that when a network is congested that the hardware can signal that there is congestion present on the network instead of dropping the packets. From there, both the sending and receiving side should adjust the way packets are sent to accomodate for this network congestion until the bottleneck is resolved.
is there any TCP algorithm support L4S in IOS 16?
To my knowledge, no. It is only supported for QUIC.