Barbecue sauce with onion
Unless he actually canned the sauce (processing the jars in boiling water bath or pressure canner as appropriate) and was working from a trusted recipe, no, this is definitely not safe.

It takes processing like this to make canned goods shelf stable. And the recipe is important too; for example if the pH isn't low enough it's not safe to use the boiling water bath method. This isn't just because of the onion, it's the sauce as a whole.

The risk here isn't just that the food may spoil. It's that something unnoticeable will grow in there, like botulism, and it could make you extremely sick or even kill you.