Rite Aid of Massachusetts will contribute $177,000 to the state’s Municipal Naloxone Fund and correct its procedures to settle allegations that its dispensing of controlled substances, including opioids, failed to follow regulations designed to prevent substance use disorder, Attorney General Maura Healey announced.