Dynamical symmetries of two-dimensional systems in relativistic quantum mechanics