Yes, the Barbary states are part of the Maghreb region.
The Barbary states are a group of North African countries that include Morocco, Algeria, Tunisia, and Libya. The Maghreb region is a larger region that includes the Barbary states as well as Mauritania and Western Sahara.