Many dishwashers have 1/2" - 3/4" gap or clearance to the counter top. This is not unusual. Many manufacturers require a certain amount of "clearance" to the top of the counter top/sides of the cabinets due to heat and humidity that comes of the machine.
The gap is necessary because dishwashers create a lot of heat and humidity. It can damage the counters to be exposed to these elements too closely. Most manufacturers recommend a gap of 1/2-3/4 of an inch.
While your dishwasher does not have to be flush with the cabinets and countertops, there are benefits to the parallel installation. A flushed dishwasher makes it easier to maneuver through your kitchen, creates a cohesive look within the space, and prevents unanticipated plumbing challenges.
You will need to purchase a pre-finished cabinet frame filler. They typically come 3" wide x 36" long. The dishwasher must be removed, the filler installed and attached to the cabinet and the the dishwasher installed mounting to the filler.
Corner locations need at least 2 inches of space between the side of the dishwasher door (when open) and the wall or cabinet. Check for any obstructions that would cause the dishwasher motor to touch the floor of the opening, such as carpeting or loose, uneven tile.
Ideally, a dishwasher should stick out 1.5″ from the counter. In the case of the top controller dishwasher, it sticks out 2-3″.
Cover the joint between the panel and the existing cabinetry, if it is visible, using caulking or wood putty colored to match your cabinets. Place a bead of paintable caulking all along the seam and smooth it with your finger. Paint if necessary to create a seamless finish.
Standard Dishwashers
The vast majority of undercounter dishwashers measure approximately 24 inches in width, 24 inches in depth and 35 inches in height with adjustable feet. This means that the rough opening in your cabinets must be 24- by 24- by 35-inch.
Considered the standard style, typical built-in dishwashers are about 24 inches wide, 24 inches deep, and 35 inches tall to fit most cabinet openings in residential kitchens.
Some dishwasher models have the same standard height and depth but come in different width sizes. Compact dishwasher dimensions for space-saving, smaller kitchen options are 17 5/8 inches to 18 inches wide. If you need a larger appliance, there are brands that feature dishwashers 30 inches to 42 inches wide.