The description of the compulsion spell states:
[…] Until the spell ends, you can use a bonus action on each of your turns to designate a direction that is horizontal to you.
Each affected target must use as much of its movement as possible to move in that direction on its next turn. It can take its action before it moves. After moving in this way, it can make another Wisdom saving throw to try to end the effect.
A target isn't compelled to move into an obviously deadly hazard, such as a fire or pit, but it will provoke opportunity attacks to move in the designated direction.
Reading the spell again it says they can use their action before moving but what if they don't? Do they then have to dash to use "as much of [their] movement as possible"?
What about rogues? If they are affected by it, do they have to use their bonus action from the Cunning Action feature to Dash? The spell only permits their action, not their bonus action.
The creature(s) does not have to dash
Actually, compulsion seems quite carefully worded around to avoid that. Let's look at a couple of points:
If the spell forced taking the Dash action it would say so. For example, fear states:
Compulsion explicitly states the creature can use its action before moving:
If it was forced to take the Dash action no such clause would be necessary.
Compulsion specifically forces to use their movement to move in a direction, not to move as far as possible during their turn. Unless the creature chooses to use any of their action, bonus action, or other resources (which the spell does not compel them to do) their movement is only equal to their speed.