Remarks on the variational nature of the heat equation and of mean curvature flow