Yes, pectin and agar agar can be substituted pretty easily for each other. These are both plant-based and safe to use in many recipes. Agar agar is commonly added to sweet and savory dishes, but pectin may be too sweet for recipes that aren’t desserts or sweets.