This answer is for my assumption that you want to go camping on your own/with friends (without guides and porters), and this comes from someone who has camped and hitchhiked a lot in a country where relatively very few people do so.
Camping in national parks is strictly illegal unless done in a designated campsite after paying authorities. If caught illegally camping, you will be subject to a hefty fine and sometimes imprisonment or even both. Unlike the police in Sri Lanka, wildlife officials cannot be (easily) bribed, so don't expect to get away easily.
To book a designated campsite, you can book them from the wildlife department office at Battaramulla, Colombo in advance. You can get a travel agent or your hotel to do this for you as you have to book in advance, especially during the holiday seasons.
It is useless camping in the dry zone of the island for numerous reasons. It is dry and hot with few sources of water if you don't camp by a river. Also, if an elephant doesn't trample you, a bear, leopard or croc might eat you for dinner. Even if that doesn't happen, there many venomous snakes around that could kill you. However, the eastern part (also in the dry zone) of the country is a nice place for camping, however, if you are not a local, I advice you not to, and I have put my reasons in this answer.
The wet zone of the country is more suited to camping, and the highlands are the best. Try Horton plains national park (they have designated campsites) or you can legally camp along Belihul oya or Hirikatu oya. If you need additional info, I can help you in this regard. Just open a new question and let me know. Camping is also possible in Sinharaja and knuckles reserves. Although non-existent in altitudes over 1500m, leeches are the biggest nuisance when camping in the lower highlands (This is the case in Sinharaja). Mosquitoes may also be an issue. However in the higher altitudes, there less of these, and also lesser snakes and other venomous animals. Leopards are found in the highlands as well but in Sri Lanka they are not known to attack humans and they are quite rare. So if you want to just pick up your bags and go camping, one of the above maybe your choice.
It is illegal to light bonfires and you should not do that. In dry periods, forests even in the hills can catch fire and this happens quite regularly. So make sure you douse out any small fire you make to cook food.
Camping in Sri Lanka is very safe as long as you keep within the law. There is more danger from nature than from people. Never ever camp near streams or rivers in the highlands as water levels can change very quickly in a matter of minutes. Keep your tent closed at night and if some animal such as Sambhur or wild boar approach at night, keep silent and relaxed. Do not try to feed them. In general, Sri Lanka is a very safe country and you should not have to worry about anything if you excise common sense.
Happy camping!