Nearby sharing will work between compatible PCs as long as the devices have that feature. It is independent of whether one has Windows 10 or 11. In other words, someone with Windows 10 can use Nearby sharing with another who has Windows 11, and vice-versa.