A dishwasher can be placed beside either.
You would use a dishwasher end panel on the end next to the appliance.
These are usually available in 3" and 1 1/2" widths. They can also be cut down to fit your allotted space.
Hope this helps