There is to the extent that federal legislation, both in the unionized government sector and private sector, allows discriminatory practices against union-free people in favour of unionized people. So collective agreement provisions that allow an employer and a union to agree to discriminate against someone because they don't have union membership status are examples of something that's legislated right in.
The federal government sector is like the rest of the world. There is no collective agreement between the federal government and, let's say, the PSAC, where you have to become a member of the PSAC and remain a member in order to keep your job. But that's not true under the Canada Labour Code, for example. Union membership can be forced by agreement of the union and the employer.