In the US mandatory union fees for the public sector were struck down by the supreme court, I'm not sure if this also applies to private sector jobs though. This was due to the Janus v AFSC ruling see. https://www.supremecourt.gov/opinions/17pdf/16-1466_2b3j.pdf