It was never quoted as such by our heroes, so I guess it's quite possible that a Space Parakeet once ate a thousand ships for breakfast, or a spatial twist caused the entire 5th Fleet to fly into a star and burn. Space does have a reputation of being dangerous in Star Trek, and Starfleet is considered an employer full of risky surprises.
Starfleet has also apparently fought many, many wars - it's just that the Dominion one was the first one to happen onscreen, that is, to our heroes (and not to the guest stars or offscreen nobodies) and during the time period when the cameras were following them (and not during their formative years or something). There's lots of potential there for military disasters, be they bloody battlefield defeats or humiliations of other sorts.
Timo Saloniemi