If it was brought to court, the judge would tell person A to put a muzzle on the dog, but i doubt person B would get anything in terms of money for hospital bills since he was warned (assuming both are adults). Though, if person B was a child, that's tough, since kids don't usually listen anyway, that might result in something harsher along w/ the muzzle, but idk if the dog would be put down, since the owner made the effort to warn them. If person A was a child, again, muzzle, person B wouldn't get anything.
I think in regards to who should take responsibility, it should definitely be the dog owners, seeing as they know the temperament of their dog. Muzzles exist for a reason, and you CAN train a dog to not bite strangers if you get it as a puppy and socialize it with a bunch of people. Plus what if the dog gets away from the owner during a walk and attacks somebody? Or maybe the owner walks past a parent with a child and the child tries to pet the dog without asking, you can't blame the kid.
The person with the potentially violent dog should make the best effort in assuring no one will get bit. If you feel like you'd have to warn someone to not pet your dog, why not just get a muzzle and be sure it won't bite anyone?