It's virtually impossible to get an accurate read on whether BJ's or Costco has definitively better pricing overall — and people have certainly tried.
Personal finance writer Lauren Greutman looked at 40 different items available at Sam's Club, Costco, and BJ's and concluded that BJ's prices beat out the others' more times than not (by a small margin). However, her analysis found that Costco tied or beat BJ's on certain items (like their pricing on Kraft American cheese slices and dish detergent, which were each significantly cheaper at Costco at the time of publishing).
Similarly, My BJ's Wholesale, an unofficial blog dedicated to the store, ran an in-depth price comparison looking at the store brand pricing for Costco's Kirkland brand and BJ's Berkley Jensen and Wellsley Farm brands. The blogger found that Kirkland was king when it came to some items, like generic vitamins, painkillers, dish soap, batteries, and laundry detergent, while BJ's two brands won out in terms of pricing for things like diapers, toilet paper, and paper towels.
So in the end, it's all about what you are regularly buying — if you're a savvy shopper who enjoys hunting for the best prices and doesn't mind trips to multiple stores to get those bargains, getting certain products from BJ's and others from Costco is a no-brainer.