They will produce different training inputs and for an effective muscle training, your training inputs should vary to counter the diminishing returns.
When you only do standard pushups on a hard ground, your progress will plateau at some point. When you only do dumbbell presses, the same will happen, even if you try to increase volume and/or weight progressively.
Thus, there is no inherent "better" between different exercises here if we speak about muscle and strength gains.
One thing to consider is that since DB pushups are in an open chain, the shoulder joints tend to have more stress and the load progression (volume/weight) should be a bit slower: it is easier to produce tendinitis and bursitis through overtraining and you tend to have more evasive movements and bad alignment. That's why you typically need some baseline strength and muscular stability of the joint (e.g. through pushups) already before you can really start to do progress on DB presses. On the other hand, it is easier to change the weight and do progressive loading in the first place (for obvious reasons).
You are correct, though, that in this case, the open chain is more functional due to typical daily tasks that need pushing typically being in an open chain. There, you need a high amount of constant neuromuscular adaptation to feedback. And you don't train that as much with pushups on a hard floor.
You can also do pushups with a weighted vest and TRX. This is even closer to realistic function, allows for load progression, and needs more stabilisers in your whole body.
Thus, it comes down to different training stimuli, equipment, and safety.