there are tons of U2 collborations (mostly individual band members appearing on other artist albums). As for sampling material belonging to other artists i'm sure it is allowed but only if you have permission from the band and record label to whom the music belongs. And the artists whos sample is being used will get credits on the sleeve of the single and/or album.
It is believed that U2 had to pay $50,000 in compensation in an out of court settlement because they inserted lines from the Stephen Sondheim song 'Send In The Clowns' during the Electric Co. which appeared on Under A Blood Red Sky. Subsequents copies of the album then had the Send In The Clowns snippet removed
Have a look at the link above and look at the menu that drops down the left of the page. There you can see which band members have collaborated with other artists