I have an iPhone 6s that i'd like to jailbreak, but it is locked to a carrier. I wouldn't be unlocking it, as id like to sell it back to the carrier at some point in time. Is it possible for me to jailbreak, use tweaks and mods for a while, then restore my phone and sell it back?
Sure; provided that you don't brick it accidentally, restoring it in iTunes will remove any evidence that it was ever jailbroken. When I bought my 6+, the 5S I sent back to the carrier had been jailbroken the entire time I owned it. I restored it to factory before sending it back and no one mentioned anything. Same thing when I updated from the 6+ to the 6S+. Restored the 6+ and the carrier didn't complain.
Jailbreaking does violate your phone's warranty. If that is a condition of your agreement, then yes, it will impact your ability to do so.
Also, make sure that you don't install and tweaks or mods that brick your phone or mess with data, etc.
Otherwise, you should be fine, but I'd check with your carrier to be extra sure. Jailbreaking isn't illegal, so long as you don't use illegal tweaks (free in app purchases, etc)