Most of the American sites like newegg, bestbuy, tigerdirect etc.. will NOT ship to Sri Lanka, and most of them even don’t accept foreign credit cards. But there is a way to get around this if you use a service called
Shop&Ship by Aramex. Its a courier company like DHL but they give you a special service where you can have a PO Box in either US or UK, with a Credit card valid in the US. With that you can buy from those American sites and ship ot to your PO BOX in US, then Aramex will collect the goods and ship them to SL. You can collect them from Aramex office or they will deliver it to your home. Call them and get more details, they have a Sri Lankan branch, I used that service like 4 years ago, not sure if they still have it in SL.
On the other hand to order from an auction site like eBay you don’t need any of that. All you need is a PayPal account tied to a local credit card. As I said before eBay is an auction site, therefore it is composed of thousands of individual sellers, eBay is not an online shop like newegg. You can buy anything from eBay as long as the seller has international shipping. If you buy small cheap items that are like less than $100, customs will not stop them; item will be delivered to your home. But of you buy expensive items with a high duty then customs may stop it and you’ll have to go and collect it from their office.
As for the warranty, it depends on where you buy it and their warranty policy. You'll have to send it back to them if something happens, and in most cases you have to pay the back and forth shipping cost. Therefore I don't recommend eBay or any other international sites for buying expensive electronic items.