In that situation, for us, it would depend on the customer and our relationship with them. For the sake of the business, we would not admit any liability in writing or otherwise. This is business, and lawsuits are possible even amongst family. I will not call them liars or cheats, just hedge and say we need to see it.
That being the case, if the customer is that allergic to onions, then they will likely have a habit of checking food from outside sources before eating it. Onions on pizza have a pungent aroma, even if one slice. As soon as the box was opened, the aroma would waft out . . . unless it is cold. My inclination would be to offer a refund just because, and let them know that if they can bring me part of the pie that had onions on it, I would look into what else we would be able to do to make it right. I gotta have a piece of onion pie, though. Business is business, and I gotta see what happened in order to correct the situation for future in kitchen and make restitution appropriate to the situation.
If it is our close friends, or ‘inner circle’ customers, our reaction becomes different and more personal.