All accessories in the box carry the same warranty or AppleCare coverage as the main device. Separately purchased accessories have a standard 1 year warranty in the United States as well as most other countries. There might be longer warranty periods in other countries are required by law.
I've had a cable replaced under warranty, but all the damage was internal. I had it covered up with all sorts of tape and shrink tubing, but when I brought it into an Apple Store they specifically wanted to see the boot and the cable jacket to see that it wasn't frayed. I was specifically told that I couldn't get a warranty replacement if the cable was frayed in any way, as they consider that signs of improper use.
I haven't had an Apple OEM Lightning cable fray, but I have a variety of MFi Lightning cables that have.