I wouod think contaminated product would be pulled, lawsuites would happen if not.
You should always wash produce to remove microbes. Onions have layers, so if you're concerned with spoiled food, or discoloration in the outer portions of the onion, peel that away. If there's a soft spot, cut it out.
Thanks! Your answer is awaiting moderation.