In the comedy drama, Carrey plays jailed conman, Steven Russell, who falls in love with his fellow inmate (McGregor).
And the 48-year-old actor told US magazine Parade that he had no problem locking lips with the Scots-born star.
Carrey, said: '[It was] a dream come true. I mean, look at the guy. I have to say, he is a great kisser. As Ewan said, 'When you're kissing another guy, it can get a little prickly'.
“Actually, you had to put out of your mind your own sexual preference and just try to understand that you were loving another person, who just happens to be a guy.'
Carrey, who split up from long-term girlfriend, actress Jenny McCarthy earlier this year, added: 'It wasn't about male or female; love is love.'
The Ace Ventura star also revealed how he slashed his normal fee to star in the indie movie, which is set for release in the US on 3 December.
He said: 'There are very few scripts that I would come across that I would pay to do and this was one of them. I didn't mind taking a big salary cut.”
He added: 'The one thing that always stayed with me was the idea that he [Russell] was relentless about love, and all of us understand that. I'm a desperate man myself.'