Absolutely! The easiest way to rev a manual car engine while you’re driving is to press the clutch, then press the accelerator. While the clutch is pressed, you won’t affect your speed by pressing the accelerator, so the engine will rev instead.
If you’d rather, you can also press the clutch and shift into neutral while you’re driving. Then, you can rev your engine by pressing the accelerator before shifting back into drive. This is a less direct way to rev your engine, but it also works without changing your driving speed.