What is the difference between butter and margarine from a dietary point of view?
From an energy perspective butter and margarine are similar in fat/oil content.
From the perspective of their (saturated, mono-unsaturated and polyunsaturated) fatty acid content, butter and margarine differ. All margarines are richer than butter in mono- and polyunsaturated fatty acids (because they use vegetable oils and fats), while butter has a majority of saturated fatty acids (of animal origin).
It is desirable to strike a balance in the use of the different products.
For further details on the precise composition of margarines or fat- or oil-based spreads, you should refer to the nutritional labelling on the product packaging.