They are both wrote about the decline and fall of an empire but observe how this comes to be through different eyes and resolutions.
Asimov’s approach in ‘Foundation’ is one of a historian. He describes how bureaucratic inefficiencies and a disconnected oligarchy caused the end of the Galactic Empire. He does so analytically and logically throughout ‘Foundation’ and ‘Foundation and Empire’. He changes in ‘Second Foundation’ when he introduces a proper protagonist/antagonist narrative. He had to. The first two books were an amalgamation of published short stories with a common theme. To continue the story beyond the first two books he had to shift style and construction. From ‘Second Foundation’ to his last Foundation book he continues the narrative in this way but never abandons the logic (as questionable it becomes) of the events to the end.
Herbert tells the same story but from a more traditional mythological saga approach. The story of how the empire falls and rises again is the story of the hero’s journey. It begins with Paul Atreides and ends with Duncan Idaho, the last “true Atreides” (I do not include those works by Brian Herbert and Kevin J. Anderson because those books were not part of the original vision). Herbert tells the story as a storyteller. Where ‘Foundation’ stresses the “Science” ‘Dune’ is all about the “Fiction”. AppleTV failed with its version of ‘Foundation’ because David S. Goyer and Josh Friedman tried to make it into something it wasn’t, a mythic saga. Nothing in the first book lends itself useful for this kind of format. Asimov’s ‘Foundation’ is systematically logical and few on character development. To adapt it, Goyer and Friedman used a familiar narrative, and it is the reason it feels more like a bad imitation of the worst ‘Star Wars’ tale. This is not the same for Denis Villeneuve’s ‘Dune’. Herbert’s ‘Dune’ is a mythic saga. Other than changes by the director for running time and artistic interpretation it is the same story by Frank Herbert. ‘Foundation’ failed with audiences because it tried to be something it wasn’t, and ‘Dune’ succeeded because it was what people expected.