While it is possible to use margarine instead of butter in the recipe, it may affect the taste and texture of the cookies. Real butter provides a rich and creamy flavor that margarine may not replicate. For best results, it's recommended to use butter as specified in the recipe.