(abridged) Context: Main-sequence late-type stars with masses less than $0.35 M_odot$ are fully convective. Aims: The goal is to study convection, differential rotation, and dynamos as functions of rotation in fully convective stars. Methods: Three-dimensional hydrodynamic and magnetohydrodynamic numerical simulations with a star-in-a-box model, where a spherical star is immersed inside of a Cartesian cube, are used. The model corresponds to a $0.2M_odot$ M5 dwarf. Rotation periods ($P_{rm rot}$) between 4.3 and 430 days are explored. Results: The slowly rotating model with $P_{rm rot}=430$ days produces anti-solar differential rotation with a slow equator and fast poles, along with predominantly axisymmetric quasi-steady large-scale magnetic fields. For intermediate rotation ($P_{rm rot}=144$ and $43$ days) differential rotation is solar-like (fast equator, slow poles) and large-scale magnetic fields are mostly axisymmetric and either quasi-stationary or cyclic. The latter occurs in a similar parameter regime as in other numerical studies in spherical shells, and the cycle period is similar to observed cycles in fully convective stars with comparable $P_{rm rot}$. In the rapid rotation regime the differential rotation is weak and the large-scale magnetic fields are increasingly non-axisymmetric with a dominating $m=1$ mode. This large-scale non-axisymmetric field also exhibits azimuthal dynamo waves. Conclusions: The results of the star-in-a-box models agree with simulations of partially convective late-type stars in spherical shells in that the transitions in differential rotation and dynamo regimes occur at similar rotational regimes in terms of the Coriolis (inverse Rossby) number. This similarity between partially and fully convective stars suggests that the processes generating differential rotation and large-scale magnetism are insensitive to the geometry of the star.