No, they don't buy into it. Plus, in a lot of cases there is literally no way they COULD buy into it. Airbus, for example, put up a tent at the Washington DC Pride. Yet, no gay people bought any airliners as a result.
Many corporations simply want to demonstrate that they augment their business model with awareness of the impact they have (as wealthy employers of thousands, selling products that are used by millions) on the societies around them. So they have a department of people who come up with ideas of how they might demonstrate this. Showing up at Pride and handing out some give-aways is just one of the many things on their list of suggestions to their corporate bosses. It's all so the CEO can point to something when the Board Members or shareholders ask about the corporate image.