No, "Delivery" missions - where the faction asking you to make the delivery supplies the cargo from the depot - has specific, unique cargo, designated as "haulage" in your cargo hold. You cannot substitute it for other cargo. TYou cannot legally sell this cargo either (though you can jettison it or get rid of it in the black market). If the mission cargo is destroyed (either because your ship was destroyed with it onboard, or you "lost" it to a pirate with a hatch-breaker, or you accidentally jettisoned it in Supercruise, or you sold it to the black market) then the mission is no longer fully completable.
The "partial completion" mentioned by Vardaugas only applies if you only lost part of the cargo. If, for example, your mission was to take five tonnes, but a pirate stole one tonne of them, then there's still four tonnes of mission cargo onboard. You only get half the promised reward for a partial completion. But if you blew up with all of the mission cargo onboard, then there is no hope - you must fail and abandon the mission.
If you want a logical in-game explanation for why you can't simply substitute the cargo, well, the mission provider says that the cargo is "medical supplies" - but who knows what's really in those crates. The "medical supplies" might actually be something much more valuable (maybe illegal drugs? Illegal experimental genetic engineering equipment? Maltese Falcons?), which won't be present in generic goods you try to substitute them with.
In truth, the out-of-game explanation is somewhat more mundane. Cargo substitution like this used to be possible, but FD put a stop to it because players "cheated". A typical "exploit" ran something like this: fly your empty trade ship out to a remote starport like Robigo or Sothis and accept dozens of delivery and smuggling missions from there back to the Bubble (which paid really well, because of the long distances required). Sell all the "mission cargo" on the market there in Sothis. Fly your now-empty ship back through hundreds of light-years of Anarchy space, to somewhere near the destination, safe in the knowledge that your "cargo" can't be intercepted enroute. Purchase replacement cargo in a nice safe system a single-jump away from the destination, and hey presto - long-range profits for minimal risk.