The NEC doesn't prohibit connecting directly with NM cable but the majority of the dishwashers I inspect are cord and cap connected for three good reasons.

1. It's easier to connect a cord before they install the dishwasher and have a receptacle in the sink base cabinet to plug it into. Cord to be 3-4 feet long max. See 422.16(B)(2)
2. You now have no issues with having a disconnect at the appliance.
3. The plumber now doesn't have to deal with a hard wired connection when he/she has to pull the unit out for servicing.


George Little