You certainly can sand concrete before applying a stain, but this may not be absolutely necessary. Sanding before staining ensures that the stain penetrates the surface, but this is only necessary if your concrete floor's surface is otherwise incapable of absorbing liquids. Consider your options before you rent sanding equipment and perform potentially unnecessary work.
If the reason you want to sand the floor is because of stains, try cleaning the floor first. Grease stains are particularly important to deal with before staining, because they can affect pigmentation and prevent proper color penetration. You can clean a cement floor by mixing 1 cup of trisodium phosphate or 2 tablespoons of degreasing dish detergent with 4 gallons of water and using a stiff-bristled scrub brush to scour the entire floor. You can remove remaining material and lose dirt by rinsing with water and vacuuming with a wet vac.
If the concrete floors are particularly smooth or have been polished, you should sand them before staining. The best concrete surface for staining is rough and porous to allow good color penetration. Smooth, glossy surfaces will prevent all types of stains, even acid stains, from properly sticking to the floor.
Water Absorption Test
Even if the surface seems rough and porous, it may still need to be sanded. There's a very simple test you can perform to determine whether you should sand concrete before staining. Pour about one tablespoon of water onto the floor, then let it sit for 10 minutes or so. If the concrete floor completely absorbs the water, you can then stain it without sanding. However, if the water remains on the surface, you will need to sand the floor to ensure proper penetration.
Concrete requires heavier sanding equipment than wood. Unless you're working on a very small surface, you shouldn't try to do this by hand. The job will require a belt sander or a floor sander with heavy duty silicone carbide sandpaper. Grinders are also effective, but they can leave a rough texture that may not be desirable for your project. Ensure that you sweep up any dust you create and mop the floor well before staining to prevent compromising the job.