The salary number itself yes, but it's only useful when linked to the identity of the employee. And in places with sane privacy laws that's illegal to do without the employee's consent.
It is your presonal information and it is not owned by your employer.
Your employer may have some right to share aggregated data, but not data that identifies you.