One answer: Closed loop systems and/or sensor fusions
You can't just send the right commands to the motor and expect that the robot will act exactly as expected. Think about a very very small difference in the torque produced by your two motors that received two identical PWM signal (due to motor manufacturing tolerances). One will go slightly faster than the other and the robot will run along a circle (very big, but still a circle) instead of a straight line.
The answer to this problem is closed loop control. Your motors, or your wheels will have encoders. And your control system will receive the signals from the encoders and will react in a way that ensure that your wheels are doing exactly what you expect them to do.
But in the case of an autonomous robot, this in not enough. Think about having a wheel that is slightly bigger than the other, because of wearing, or just due to manufacturing tolerances. Or think about a wheel that slips a little bit on the floor. In this case you don't know anymore for sure where you are. This method is called odometry or dead reckoning. In order to solve this, you have to use sensors that adds knowledge about your environment to your system. (Vision, proximity sensor, bumpers, magnetometer, gyroscopes, etc). Then, advanced algorithms are used to use the best of every sensor at each time step.
A permanent magnet DC generator (or a generator with constant field excitation) can be modeled as a voltage source proportional to velocity (angular velocity in the case of a rotary generator) in series with some coil resistance.
Since viscous damping requires a force proportional to velocity, simply loading the output of the generator with a variable resistance RL will create a variable damping factor proportional to RL+RG (where RG is the winding resistance). We want the torque to be -c\$v\$ where \$v\$ is the motor rotation speed to simulate viscous damping, so in this case c = \$k(R_L+R_G)\$, where k is a constant that depends on the generator construction.
An electronically-variable resistance can be created by literally switching resistances in and out, or it can be done with a MOSFET or BJT electronic load that simulates a resistance. The maximum damping with a passive load is limited by the internal resistance of the generator. With an active load and external power supply it should be possible to simulate a negative resistance externally to further reduce the total equivalent resistance.
For linear motion, a linear PM motor could be used, or a rack and pinion used to convert linear to rotational motion.
A second method, most useful if motion is guaranteed, would be to use coulomb friction (for example as a caliper and brake pads dragging on a rotor) and control the force applied to the brake pads using a torque motor or other method (for example change the position of an actuator that is spring loaded, so use Hook's law to determine the force). This works because dry friction is proportional to the normal force applied, and the proportionality factor \$\mu\$ is a function of the materials involved
However, this method will have stiction (nonlinear behavior) before motion starts.
Best Answer
You could use a generator as a variable load. Use a PWM signal to short circuit the output of the generator. Shorter duty cycle is less load, longer duty cycle is more load.
A generator is just a motor whose shaft is turned by an external force.