Outside theory, I don't see that working very well in the real world currently.
On amazon fresh website, there are currently
229 results for "green apples"
8 results for "granny smith apples"
2 results for "1 granny smith apples"
Same with ham, eggs, or any other products really. Sure, the user could be more specific, but then it gets a lot more work and problematic than simply scan the damn barcode for this "4-in-1 pack of organic spanish strawberry yoghurt march special offer".
Next - presuming that you bought something from Amazon, why do you need the barcode? If I recently bought and/or regularly buy granny smith apples from Fresh, it's quite easy to figure out the most probable buying targets for queries of "apples." Further, if I regularly buy 5 different types of granola bars, now I can use one query and a checkbox instead of scanning each box individually. (Sidebar: how do you use Dash to scan produce that you've already consumed? Do you have to keep the containers around?)
In the big scheme of things, figuring out which product you probably want to buy based on your buying history (and that of others) is a trivial problem compared to the other problems that had to be solved for "always listening" and such. Amazon's job ends up being the easiest in that stack.
risk vagueness and inaccuracy
You're scanning a barcode of an item you recently purchased from amazon. Where is the vagueness in querying for that item by type?In most cases, your pantry has 1 type of each item, which means you've got a canonical mapping from "pasta sauce" to an item in your fridge. That also means you've got a very high probability of mapping the recent purchase of pasta sauce to the query of "pasta sauce." Where is the vagueness?
In the worst case, you've bought two or three different types of pasta sauce, and you'd like to replace just one. Let's be clear - this is most definitely the exception to the rule. In this case, your phone gives you a list of options to choose from -- the list of your N most recently purchased pasta sauces (backfilled by prior orders or popular choices).
"Same type as last week?"
"No, the ones I bought before that"
"OK, ordered XXX apples"
Option A
1. Ask your phone to buy {name of item}
2. Screen turns on, tap to confirm your purchase
Option B
1. Find the Dash device
2. Scan the item (if you haven't already discarded or recycled it, and haven't ruined the barcode in the process of opening it)
3. Confirm and pay
To me, Dash feels like a (possibly unnecessary) stopgap on Amazon's part. I understand they have the means to try things like this, but selling a device seems superfluous given the developing capability and direction of phones. As an Amazon customer, I hope Option A is their endgame.