Can tube margarine be substituted for butter?

Only if the margarine is not "light" (lite or low-fat / lo-fat.) "Light" margarines have a high proportion of water to fat, and will not bake properly.