Sub-floor is meant to be flat and level. If not, your finish floor--the solid hardwood, laminate, tile, or other exposed flooring that goes on top of the sub-floor--will never be flat and level.
This problem can be fixed, but it all depends on exactly what kind of uneven you have--general sloping or waves within the floor perimeter itself.
General Sloping Issues
Floor Slopes From One End To The Other End
A general slope means that one end of the room's perimeter is lower than the other end, the classic scenario where, as the saying goes, the peas roll off the plate in the dining room.
Determine if all four sides are level with a laser level. Laser level technology is now affordable to homeowners, not just contractors. It's worth spending $30 to $100 for an inexpensive line laser to determine floor level.
If your room is out of level from end-to-end, this means that your problem resides below and you cannot fix it with underlayment. An entire foundation wall or foundation footing may be in bad condition or the ground itself its subsiding (or all of the above).
Floor Slopes Toward the Middle
When all four sides of a room's perimeter slope down toward the middle of the room, this usually means that joists and/or beams below the sub-floor are sagging, termite-ridden, or in rare cases, broken.
Wavy, Undulating Sub-Floor
If all four sides of the room's perimeter are level, then the problem is within that perimeter and likely can be cured with underlayment and /or leveling compound.
If the undulations, or waves, span about 4" or less, then putting down a 5/8" plywood underlayment alone should span and effectively bridge the depressions.
For ceramic tile, which requires a rock-solid base to avoid cracking grout or tile, fill these small waves with leveling compound.
Other types of flooring are more forgiving: laminate, solid hardwood, and engineered wood to a limited degree. Vinyl flooring is especially forgiving due to its pliable nature.
If the waves are wider, then plywood alone will not provide a sufficient base for your finish flooring of any type.
Wider waves can be filled in with a self-leveling compound. Self-leveling compound comes in big pre-mixed buckets or in dry form that can be mixed with water.
The reason it is called self-leveling is because you merely pour the liquid compound onto the floor, and like water, it seeks its own level. You do not need to screed the compound or touch it in any way.
If the depressions are deep, the leveling compound will fill in only those areas, leaving high areas dry. If the depressions are shallow, you may have to cover the entire floor with leveling compound.
After the compound has fully hardened, you can install underlayment.