Flatpak has better security features than docker. While its true it’s not designed with server apps in mind, it is possible to use its underlying “bubblewrap” to create isolated environments. Maybe in the future, tooling will improve its features and bridge the gap.
They’re similar under the good, but flatpak is optimized for desktop use. Docker targets server applications.