in short: yes, you can use margarine instead of butter, and vice versa. due to its ability to be whisked easily and maintain air, butter is a basic ingredient in baking. margarine is similar in appearance, taste and smell to butter and is used as a butter substitute in confectionery products.