She didn't choose to violate genre conventions. She doesn't read fantasy in the first place, and Harry Potter wasn't intended as a (high) fantasy.
In an interview with The New York Times, J. K. Rowling said the following:
Any literary genre you simply can’t be bothered with?
“Can’t be bothered with” isn’t a phrase I’d use, because my reading tastes are pretty catholic [lowercase in original]. I don’t read “chick lit,” fantasy or science fiction but I’ll give any book a chance if it’s lying there and I’ve got half an hour to kill.[...]
She also didn't consider Harry Potter and the Philosopher's Stone a work of fantasy until after she'd written it. Another answer to the linked question contains numerous additional quotations indicating that Rowling doesn't like or read fantasy, so I'm going to consider that a well-established fact.
Given that Rowling does not read fantasy, we have to interpret Harry Potter in the broader context of English literature rather than as an intentional work of high fantasy. Comparisons with The Hobbit and other works in Tolkien's legendarium are particularly inapt, because those works spawned a literary and cultural canon which Rowling has intentionally avoided.
Dragons are, of course, fearsome creatures. But there is also a longstanding tradition, far older than Tolkien, of individual knights slaying them. Probably the earliest surviving example which can be called "English" in any sense is Beowulf, but of course there are numerous more modern examples. The dragons used in the Triwizard Tournament are a continuation of that literary trope. The "knights" are schoolchildren because the protagonists are schoolchildren. Finally, they didn't actually slay the dragons. They just had to retrieve an egg.
Turning to broader genre differences, it's clear that Rowling was intent on writing a "civilized" world, in which humans have a substantial level of control over magic. The dragons (and various other magical creatures) are kept as pets. The elves are enslaved. The goblins once rebelled, but now they merely run the economy. Why? Because Rowling was not writing a fantasy in which "anything can happen." She was writing a boarding school story which just so happened to be set in a magical environment. Boarding school stories can have a substantial level of mischief (think of Harry and company sneaking around with the invisibility cloak), but a common baseline assumption is that the school is mostly safe and mostly a civilized environment, in which children need only moderate adult supervision.