We consider the evolution of curve networks in two dimensions (2d) and surface clusters in three dimensions (3d). The motion of the interfaces is described by surface diffusion, with boundary conditions at the triple junction points/lines, where three interfaces meet, and at the boundary points/lines, where an interface meets a fixed planar boundary. We propose a parametric finite element method based on a suitable variational formulation. The constructed method is semi-implicit and can be shown to satisfy the volume conservation of each enclosed bubble and the unconditional energy-stability, thus preserving the two fundamental geometric structures of the flow. Besides, the method has very good properties with respect to the distribution of mesh points, thus no mesh smoothing or regularization technique is required. A generalization of the introduced scheme to the case of anisotropic surface energies and non-neutral external boundaries is also considered. Numerical results are presented for the evolution of two-dimensional curve networks and three-dimensional surface clusters in the cases of both isotropic and anisotropic surface energies.