You might get more information at an adult related forum...try ynotmasters.com.
Many hosting companies CHOOSE not to be involved in that kind of business.
Some will allow "certain things.".
Some are ONLY in that business.
It's not really a legal issue, it's a business decision...
Yes adult sites are legal. As has been pointed out the host is who chooses what sites they are willing to host and many CHOOSE not to host adult related sites (as the do with IRC networks etc).
1 of the main things you have to do in America and quite possibly alot of other countries is have proof that anyone used is over the age of 18/21 (can't remember which). Also you have an obligation to ensure that people under the age of legality in the any particular country is unable to gain access to the site (of course not always 100% possible)..
So mostly is the hosting company decide allow or not for adult site, not the datacenter?..
That question assumes your hosting company is just selling space on servers they lease (dedicated servers) like many do from www.ev1servers.net (huge example, and is most of their business). When that is the case, either/or can decide. Usually, however, when the datacenter leases servers knowing that most of their users are reselling their leased server space (ie: datacenter's customer/reseller being "hosting company" to end-user), the datacenter tends not to be as restictive. They usually will allow whatever the law of their jurisdiction allows, and leave it to their customer (the "hosting company") to get the slack for whatever they are willing to host. "John Doe Hosting" with a hundred or so domains hosted (even a few times more, if he's doing good business) is more likely to get into legal issues than say "Mega DataCenter" which has thousands of servers with possibly millions of domains - Simple reason being that the law views it as the host/reseller could watch what is posted on his sites alot better than the datacenter could, simply considering volume. Put simply, though, as I said above, either could prevent whatever they want to (the datacenter owns the equipment and the host leases it); but, it is usually the host who would stop such.
I won't comment on what other webmasters do, as far as that goes - As an American, I believe in the 1st Amendment. But, the law in most countries has not caught-up to technology, so (as others have stated above) it is legal in most places. And, even if the law caught-up, enough people view it, that the law may never disallow it. But a word of caution here: Not only should you check your national laws, but also your local ones. For example, here in the USA, some states will prosecute a webmaster for some adult content that is legal in other states, regardless of where the host or datacenter are located, if the webmaster runs the site from or lives in that state...
It depends on the country where you reside. In India, it's illegal...
My answer gave that answer...varies alot by state. Check yours, and that of the datacenter's..