Is there such as thing as the viscosity of stars in a galaxy, along the lines of gravitational attraction between stars changing the dynamics.
If so, how is that put in terms of the Virial Theorem?
Yes. Since the gravitational force is long-range, one star traveling through a star field tends to leave behind a slightly denser "wake" of stars that moved slightly towards its previous locations. This increased density acts to pull backwards on the fast-moving star, creating a sort of fluid friction, or viscosity. The Virial Theorem is based on a fully-randomized distribution of positions and velocities, so it absolutely requires some kind of viscosity effect to smooth out the initial distribution of positions and velocities, whatever it happens to be.
On a more technical note, a frequently used synonym for randomized is "thermalized," leaning heavily on the parallel between the statistical physics of a large number of gravitating bodies interacting and a large number of atoms or molecules interacting electromagnetically. The gravitational viscosity can be considered to use up "mechanical energy," i.e. kinetic energy that stands out from purely random motion and therefore could be used to do work without the constraints of thermodynamics, from the point of view of stars as particles. Gravitational viscosity would therefore produce "heat," or randomized particle motion, only usable for doing bulk work under the constraints of thermodynamics, like the Carnot Efficiency.