I don't think muzzling/leashing all dogs in public would work (although at first glance it seems sensible) for the following reasons:
Of course the problematic dogs won't be muzzled and yes there is a chance in a million that they will be caught and fined, but in all likelihood, they won't.
This means that when my small, muzzled, spaniel is attacked, she cannot defend herself.
If you confront the kind of person who chooses an aggressive dog and trains it to be aggressive, for NOT having a muzzle, you will be in for abuse (at best).
Some dogs NEED to run off lead. I am lucky that we have loads of green space but not everyone is lucky enough.
But mostly...
So MANY of these attacks happen in the home/front garden. A neighbour's kid/a friend/a baby. Or dogs get out of the house and go on the rampage. I would say more than half of major dog attacks reported are not happening whilst out walking but in a domestic setting.
I don't know what the answer is - although licensing and maybe muzzling on a public street IS a start.