Dozens of people rallied at the State House in support of the Safe Communities Act, which would further limit police cooperation with federal immigration authorities in Massachusetts.