In America, most states adopt ASTM D975 as their diesel fuel standard and the minimum cetane number is set at 40, plus or minus 2 (Flying J cough, cough), with typical values in the 42-45 range. California CARB diesel is minimum 50 cetane.
Gasoline is an engineered product, so that octane will be very consistent across brands and in all states. If it says 87 octane, it's 87 octane.
Diesel is a distilled product by "fractional distillation" (separating out different liquids by their unique boiling points at a given atmospheric pressure) and the cetane level can and does vary between brands and even batches from the refinery. Different batches are mixed together, anyway, to achieve a desired cetane. When distilled fractionally, diesel fuel will have between 8-21 carbon atoms per molecule, the more carbon the less cetane. Flying J refines their own and tends to refine and mix it at the minimum standards, so their diesel will often be less than 40, but is generally between 38-42. THe good stuff they save for CARB diesel. Some of their locations are (or soon to be were) co-owned by Conoco and get their diesel from a variety of refineries.
By and large, all truck stops by their diesel on the open market by contract and you can find TA, Wilco and Pilot, for example, all getting the same diesel from the same source on the same day at times. Mostly it's regional, where local fuel stops get their fuel from a local refinery. Most places in and around Michigan get theirs from refineries in Sarnia and Detroit, for example.
Most refineries will refine and sell two types of diesel, standard which is generally 42-45, and premium which is 46 and up.
If you ever see cetane numbers on fuel pumps, which is rare, it's not the actual cetane number, but the Cetane Index, which is an educated guestimate based on the density of the fuel and on recovery temperatures. Getting an exact cetane number is not easy, and requires laboratory testing conditions for combustion pressure and combustion delay. Most states (and all refineries) periodically test samples from the pump for the exact cetane number. The results are out there, but not always easy to get at.
Wilco and TA tend to be the most consistent at all locations for higher cetane, with Petro and Pilot a close second. Flying J tends to be consistent, as well, only they tend to be consistent on the low end (which is why they tend to have cheaper fuel, at least until the Pilot-Flying J merger started taking shape, where now an awful lot of Flying J's have the same fuel pricing as the Pilot across the street, and if the FTC asks me my opinion of what might happen to pricing controls if the merger goes through, neither the Pilot nor Flying J will like what I have to say).