The friendship of the three men begins with Basil. Hallward, a painter and presumably of lower social status than Lord Henry and Dorian, had already known Lord Henry Wooton through acquaintances in London. As he says himself, he has to show his face from time to time to demonstrate a degree of social civilization among the upper classes. One of the results of his mingling was meeting Lord Henry who, as an upper class aristocrat would be frowned upon by keeping the company of an artist.
Yet, we are well-aware that Lord Henry lives for being talked about, and that his interest in Basil may very well be precisely because Basil is an artist; one whose
...sudden disappearance some years ago caused, at the time, such public excitement and gave rise to so many strange conjectures.
Therefore, Lord Henry's interest on Basil does not stem from affection, necessarily, but out of the portents of how Basil's secret life could amuse and interest him.
Basil is also who meets Dorian Gray in one of those exhibitions. From Basil's description we could assume that there was an instant affinity between the two of a seemingly supernatural nature.
When our eyes met, I felt that I was growing pale. A curious sensation of terror came over me. I knew that I had come face to face with some one whose mere personality ...would absorb my whole nature, my whole soul...
In fact, the famous words of Basil's confession to Dorian may help explain that his fascination with him, to the point of "worshipping" Dorian, stem from Basil having found the perfect prospect of what he calls "beauty".
I quite admit that I adored you madly, extravagantly, absurdly.
Dorian, on the other hand, may have been a mere pawn under the control of two grown men who had an obvious romantic interest in him, however, his nature was one of self-admiration, and he clearly enjoyed the attention.
As far as the friendship between Dorian and Henry, the foundation of it is hedonism, and the need for Lord Henry to make an experiment out of Dorian's life. He wanted to make Dorian's beauty mix with Henry's own gospel of a "life for the senses", and see what came up as a result. What could be seen as corruption was not really so; it was merely the influence of a slick man, Lord Henry, upon the weaknesses of a man whose history involves death, romance, beauty, and a penchant for a little debauchery.
The three form an unlikely trio where Basil is the weakest link. In reality, Dorian and Henry have more in common with one another than they do with Basil, but it is easy to see how the nature of their attraction to one another is in part due to the idealization that Lord Henry and Basil have created of Dorian and how the latter's weak nature responds to such idealizations of him.