LEGO and fuel company commercial relationship?
The exact details of the business agreements between LEGO and the companies whose names and logos it has license to use are confidential, but we can infer some general information.

The sets LEGO has produced that feature an oil company name or logo fall into three general categories:


Sets produced by LEGO with only the branding of the oil company and without any LEGO branding on the package. These were used as promotional items by the oil company.
Sets produced as promotional items and distributed through the stations of the oil company that had both LEGO branding and the name/logo of the oil company
Sets sold in the LEGO catalog and regular retail stores that included oil company names and logos


In the first category were the 1:87 vehicle models LEGO produced for Esso in 1955. These were given away at Esso stations with a 3-liter minimum purchase of fuel. The packaging was a printed cardboard box featuring the Esso brand and its "oil-drop" man mascot. The LEGO name appeared only on the underside of the model. Because these sets did not have prominent LEGO branding, it is possible Esso simply contracted with LEGO to produce them and purchased them directly from LEGO.



At the same time Esso was giving these LEGO-made models away, however, LEGO was also selling them in its catalog with co-branded packaging:



In a typical license agreement, a company will pay an agreed amount to use another company's trade name and logo on its products. The agreement will usually indicate what products will carry the logo and the length of time the agreement is in effect. Since it appears LEGO was producing sets for Esso at the same time it was using Esso's logo on sets it sold to the public, there may have been a reciprocal agreement between the companies where LEGO "traded" its truck models for the license to use the Esso logo on its retail sets.

In the second category are sets like 1255 Shell Car Wash. These were LEGO sets with the Shell brand that were sold only through Shell stations and not made available in the LEGO catalog or at regular retail stores. 



As with Esso, however, LEGO was also producing regular retail sets that included the Shell name and logo at the same time it was producing exclusive promotional sets that were sold only at Shell stations. Since both companies stood to benefit from the arrangement, it is possible they had a reciprocal agreement where LEGO produced exclusive sets for Shell in exchange for license to use the Shell name and logo on retail sets. LEGO stopped producing Shell branded sets in 1992. In 2004, the Shell brand reappeared on some promotional sets like Ferrari F1 Racer, which include the Shell logo as well as several other sponsors of the Ferrari racing team.

In the third category are the regular retail sets that have oil company logos and names. All of the Exxon-branded sets fall in this category, as it does not seem LEGO ever produced any exclusive promotional Exxon sets that were sold only through fuel stations. In the case of Exxon, it may be that a regular license agreement was in effect where LEGO paid Exxon for the use of its name and logo for a certain length of time.

A typical license agreement also names the geographical areas where the licensed products will be sold. Prior to 1986, LEGO only sold retail Shell products in the UK, Europe and Australia. It is likely their agreement with Shell only covered these geographical areas. From 1986 to 1992 Shell-branded sets became available in the United States, suggesting that the license agreement was expanded around 1986. Exxon-branded sets were sold only in the United States from 1979 to 1982.

With the exception of some promotional sets, LEGO stopped using actual oil company names and logos on its sets in 1992 when it introduced the fictional Octan brand. At that time it appears Shell was the only oil company LEGO had an active license agreement with. It is likely its agreement with Shell had expired and the two companies agreed not to renew it. The switch to Octan has obvious advantages to LEGO as it is not restricted by any license agreements as to where the products can be sold or which products carry the logo.