In a room on the top floor of a rehearsal studio in south London, while a troupe of actors works through his new play below, Tarell Alvin McCraney shakes his head, marvelling. "Scotch eggs," says the American playwright. "Lemsip. The Six Nations. The Bill. I didn't know these things were even in my head until they came tumbling out into my script."

The Miami native has spent a lot of time in England since 2007, when his first play, The Brothers Size, was performed at the Young Vic. A year later, his second play, In The Red and Brown Water (like the first, set in Louisiana), required flooding the Young Vic's arena under two feet of water. Since then, McCraney has put on a drag show at the Royal Court and taken a 70-minute interpretation of Hamlet around British schools. That makes four years on and off in the UK – and the crystallised result, when he sat down to write his new play, was a London setting, a cast of eccentric British characters and the emergence of that subconscious scotch egg.

The play is called American Trade, at the Hampstead theatre in London. For "trade" read prostitution, the central character being an American gigolo called Pharus who comes to the capital to "set up shop". The RSC, which commissioned the piece and for whom McCraney is a writer-in-residence, is calling it "a contemporary restoration play". Because, explains McCraney, "there's lot of door-slamming and innuendo and masks and manners".

He has a lot of fun with his British characters, a bunch that includes a testy immigration officer at Heathrow airport, a British-Jamaican mother and daughter who run a PR firm, a much-mocked former child star, an east London cabbie and a Mumbai-born model. Inspiration, says McCraney, came mostly from travelling on buses or walking about town, keeping his ears open. "The cacophony of accents and languages in London is just mind-boggling. New languages, new worlds every few steps. I've spent a lot of time in New York, which thinks of itself as pretty diverse. It is... but London takes the crown."

Beyond the farce, and beyond some frank sexual language that ought to earn the odd gasp in NW3, the new play is at heart a study of "fitting in", says McCraney. "It's about feeling out of place. What does it mean to change oneself to fit an environment? Even if it's just to feel at ease or not to ruffle the community around you?" These are questions the 30-year-old is well squared to ask.

He is 6ft 3in, dressed, with impeccable neatness, in a pale blue shirt, prescription Ray-Bans folded over a low collar, facial hair carefully groomed. He is, by any standard, an unfairly handsome man; you want to cower in a corner, murmur an apology for not having made more of an effort. He is also, in his own words, "pretty fem". When he goes back to his hometown, Liberty City in Miami, it is not unusual for him to be called a faggot on the bus. He says: "Back home, they notice that I'm a little less masculine than maybe they'd like."

This is an improvement on 20 years ago. McCraney grew up living in an enclave of five or six housing projects, all inward facing, the smell of corner boys smoking weed ever present. He was eight or nine when he started noticing "artistic differences" between himself and his peers. He quite liked ballet, for instance, and preferred wearing pointe shoes to "sweatpants and Timberlands". He recalls: "I didn't know what 'faggot' meant but I found out quickly. I heard Buju Banton songs going off, telling me what 'batty men' were and what was going to happen to them." At school, McCraney was beaten up a few times. Rocks were thrown and cracked two of his teeth.

It's important to note that, straight-backed in his chair, looking off at an angle, McCraney relates all this without a whit of self-pity. At one point, to my mumbled and entirely inadequate commiseration, he beams: "I'm all right!" The shitty years led him, anyway, to theatre: "You think, 'Where do I put all this?'"

He was inspired to write by his grandfather, a pastor known for his dramatic sermons. McCraney's first performed work, written when he was 14 for a local drama group, was a monologue about a person suffering from Kaposi's sarcoma, an HIV- and Aids-related condition that severely blisters the skin. His mother, a heavy drug user, had been diagnosed with HIV some years before, "but she didn't have Kaposi's sarcoma. What I wrote actually came from a growing fear within myself." He puts a hand flat on the table in front of him, patting gently as he speaks: "There was this huge understanding that if you were gay, and you were black, well, you got Aids. It was terrifying for me. When I was a kid, people told me I had really nice skin and I thought: this one thing, the one thing people say is good about me, is going to be destroyed."

His mother died when he was 23, by which time McCraney – his early work having caught the attention of various theatre luminaries, including British director Peter Brook – was studying at the Yale School of Drama. There, he wrote The Brothers Size, about two brothers whose close relationship is tested by the incarceration of the younger one.

In 2007, it was performed at New York's Public theatre and then at the Young Vic. Not long afterwards, McCraney's youngest brother, who was "always in trouble" and inspired parts of the play, was jailed in real life. "Statistically, that's just what happens to most African-American families. Someone ends up doing time."

The Brothers Size is still being performed around the world (this year in Seattle and New Zealand), but McCraney feels distanced from it since life started to outpace the art. Experience, he says, "makes you a different person. You get a new set of tools". Happily, his brother is out of jail and doing well: "He's good, he's working, he's on Facebook." McCraney booms out a laugh.

Being made a writer-in-residence at the RSC in 2008 must have felt pretty status-affirming; regular feting by the New York Times and British theatre critics can't hurt. But in my view the most priceless confirmation of McCraney's place in culture came in the form of a name-check on David Simon's impossibly cool HBO drama, Treme. In an episode broadcast in the UK last month, two characters, a couple, discuss their "free passes" – the people they might be forgiven for having an affair with. The woman nominates McCraney: "He's gay, but he counts."

McCraney's third play, Marcus Or the Secret of Sweet, was his "coming out" play. Never performed in the UK, it is about a boy growing up, accepting his sexuality. McCraney says he has known he was gay since he was about 13, but had had inklings before he actually felt attracted to men. The effeminacy. The ballet shoes. Neighbourhood kids telling him what they thought in no uncertain terms.

"It's funny because, over here, I talk about being effeminate and people correct me: they think I'm very masculine. Maybe to you, I think, but to the people back home…" Over here, as well, people are amazed when he tells them he's gay. "I guess black guys have a different archetype that they have to hold up in America. Like there's a built-in way to conduct yourself in public over there. In London, that's a bit more fluid. So people don't automatically assume or wonder…" He booms another laugh. "Unless they want a little bit. And then it's a different conversation."

McCraney is a big laugher and quite a chaotic thinker. Over an hour's conversation, his attention alights all over: African politics ("You thought we fixed the problems in the Congo?"), then sudden digressions into ebooks, then the history of discrimination against women, then night buses. But his thoughts often tug back to that issue at the core of the new play – a difficulty "fitting in". He mentions, more than once, an aversion to settling down in any one city. He sometimes has dreams, he says, that he's back in Liberty City, "back in an environment that does not want me there".

Does he go back often? Sometimes, to see his family. He says he has plans to put on some plays in Miami. There's isn't much of an arts scene there, "but my connections to these larger institutions – the RSC, the Young Vic, the Public – will help create in Miami a place for artists to come to, or come back to. A lot of them leave."

McCraney has said in the past that playwriting, for him, is in part an act of "shoring up" – coming to terms with his old life back home. Towards the end of our conversation, he embarks on what seems like a chirpy story. Indeed, it's told with such verve that I greedily envisage it becoming part of an uplifting closing paragraph, a happy ending.

"My best friend," begins McCraney, leaning forward, "was born four days apart from me. We were neighbours, literally lived a few feet away from each other. We don't remember becoming friends we were friends for that long. At an early age, I can honestly say I knew what love was 'cause he was my best friend in all the world and I raced home from school every day to see him. And then one day he turned round and told me I was a faggot. I was nine." He pauses. "I'm, what, 30 now? We haven't spoken in more than 20 years."

Probably the most regrettable outcome of these early years, he thinks, has been a tendency to be distant in adult relationships. "I have a problem insulating myself. People think I'm being mean. But I'm just trying not to bother anybody. I felt like my presence, back in my old neighbourhood, was a bother – people were annoyed by it, they were moved to violence by it." Again I find myself mumbling something sympathetic, still a bit stunned by the best mate story. Again McCraney is no-nonsense about it: I'm all right.

And he is. He's multiply successful as a playwright in an industry with shrinking opportunity. After the mention on David Simon's show, New York magazine wrote, with sideways affection, "Fucking Tarell McCraney… you get the Young Vic, the Public and fucking Treme?" With American Trade, he's shown he can hang out in London for about 10 minutes and create a play that authentically nails certain English predilections (that indistinct "Mmm" noise, for instance, as a substitute for honest reflection). He's doing all right.

McCraney says he wasn't watching Treme when he was mentioned, but was soon told about it. He describes it thus: "Sometimes the universe just gives you a wink." And it's hard, considering, to begrudge him that.