A varifold formulation of mean curvature flow with Dirichlet or dynamic boundary conditions