Two of the nation’s most powerful unions face a potential loss of members and millions of dollars when a Trump administration rule takes effect Friday in the latest big test for organized labor.

The rule will prohibit states from automatically collecting dues from home-care workers’ paychecks. About eight states currently allow the unionization of people who provide in-home care to the disabled and elderly and whose pay is subsidized by the government.

The...