It's legal for employees to discuss their pay and compensation with each other. The only reason an employer wouldn't want that is because lower paid employees will get ****ed and either ask for more, leave, or be disgruntled.
I've worked in jobs where nobody talked about it - and nobody wanted...