The real world has plenty of examples of birds that ca swim brilliantly, so obviously wings aren't a disadvantage per se. However, there are a few caveats:
- Wings consist of very large surfaces, which means increased drag. This can be mitigated by folding the wings away. Dragon wings are bat-like, which means they fold quite neatly - in fact, because skin stretches while feathers don't, you might be able to fold them better than a bird can.
- Aerodynamics are somewhat different from hydrodynamics. You may find that a dragon whose wings are optimised for flying can't really use them to swim very well, or conversely, a dragon who can swim excellently may end up a less-than-excellent flyer.
However, besides the mechanical, there's also a biological aspect to consider. A bird's wings are mostly feather. Feathers are not living tissue, do not require blood supply, and are very good insulators. This allows swimming birds to extend their wings more or less with impunity underwater, and to retain their body heat while swimming. A dragon's wings, however, are batlike, meaning that they are mostly skin, and a dragon is covered with scales, which do not trap air like feathers. This means that a dragon will rapidly lose body heat when submerged, and the moment they extend their wings, they start to act like radiators and the dragon starts losing heat even faster. Given that dragons are lizard-like, you may decide that they are cold-blooded, which means that heat loss is a serious problem. It's not an insurmountable problem - there are aquatic reptiles in the real world, such as swimming snakes and the marine iguanas of the Galapagos Islands - but it does limit you to warmer waters only.
Alternatively, you could say that because dragons breathe fire, they have an internal source of heat, but even so, they probably wouldn't enjoy this rapid cooling. On the other hand, you could say that a dragon's internal fire causes them to overheat, and they use their dives into the sea to cool off so that they don't expire (or combust!).
This could also answer your secondary question: why can swimming dragons still fly? A dragon who breathes fire might need to dip in the sea to cool off periodically, but their fire doesn't work so well underwater, so they never become fully aquatic. If they nest above water, then they're at risk from predators and egg thieves. Nesting on cliffs or high places makes it harder for most things to reach them, which gives them a reason to retain the ability to fly. At that point their main threat is birds, who use feathers, which fire is quite effective against. In fact, fire may be more effective at nest defence than at hunting; provided the cliffs (or wherever the nest is) are largely non-flammable (so that the dragon doesn't catch itself in a forest fire), breathing fire into the air from a static, grounded position is likely easier than trying to breathe fire on a grounded target while flying over it - not to mention that using fire to hunt may result in a meal that is either unreachable due to being in the middle of a brushfire, or inedible by virtue of being mostly charcoal and ash.
Thus, you have a creature that uses fire to defend their nest against the birds who are able to reach its inaccessible location, while frequently taking dives into the sea to cool off using its large, radiator-like wings to avoid self-inflicted heatstroke or self-ignition.