There is little doubt that Dorian is based on Lord Alfred Douglas, with whom Wilde was in love. Dorian's beauty attracts both men and women, and both Basil and Lord Henry find him sexually attractive. Lord Henry describes Dorian in terms that would be more typically used by a man about a young woman ("Made out of ivory and rose-leaves"), while Basil Hallward uses the language of love at first sight: "When our eyes met for the first time, I felt that I was growing pale."
Basil's passion for Dorian makes him helpless; he becomes aware that Dorian is evil but remains under his spell. With Lord Henry the feeling is more detached; he admires Dorian, Platonically, as a perfect example of beauty, and is fascinated by his decadence, but is unhurt by him. In fact it is Lord Henry, as the older and more experienced man, who has influence (intellectual rather than sexual) over Dorian.
In order to tone down what was originally meant to be Wilde's manifesto on Greek Love,The Picture of Dorian Gray was altered by Wilde, a suggestion by Walter Pater, because of the strong homoerotic undertones between the relationship of Basil, Lord Henry, and Dorian. Although Wilde intends to present a romantic connection between the three men, he disguises it as a mere platonic relationship because Wilde was aware that NOT doing so could have caused (and eventually did cause) him to go to prison.
The role of sexuality in the novel is to present Dorian as the ideal of Greek love that every aesthete (such as Wilde and Pater) seeks, but dares not to corrupt. The beauty and looks of Dorian are consistently mentioned throughout the novel as the most powerful charms of his existence. Sensuality, and not necessarily sexuality, pervade the atmosphere of the novel. Wilde does want Dorian's supreme aesthetic look to be at the center stage of the novel, but he is quite aware that any addition to this would have rendered his novel "immoral" by the standards of his time.
For this reason, Wilde uses the theme of the platonic love to ensure to his readers (the 19th century sanctimonious Victorians) that merely because Basil and Lord Henry are attracted to Dorian does not mean that they intend to have any physical contact with him. In fact, at some points in the novel Wilde weakly tries to disguise homo-eroticism and, instead, uses "admiration", and "inspiration" as the real reasons why Basil is so smitten by Dorian's "personality", as Wilde would put it.
The Picture of Dorian Gray was sketched, written, and completed during a significant time in Victorian history; The Criminal Law Amendment Act of 1885 was enforced to criminalize homosexual relationships between males; the publication of Dorian in 1890 could have impacted Wilde much more negatively had Wilde left the manuscript unedited. Although the novel did impact him negatively during his 1895 trials for Gross Indecency, the fact is that Wilde's original language was even more "dangerous" than the version that we know today.
As a side note: Wilde did not meet Lord Alfred Douglas until 1891, which is one year after the publication of the novel, and nearly 5 years after it had been completed and edited. Therefore, the common belief that Lord Alfred served as the inspiration behind the creation of the character is not accurate.