Modifying your truck won’t automatically kill your warranty. People replace speakers in their new trucks all the time, but that won’t affect the warranty on an unrelated component.
The factory tune is meant to maintain a certain tolerance to ensure reliability. Toyota is know to under-power it’s engines, but it’s super reliable because of that. If you tune it to get more power, then obviously, Ford can deny warranty coverage if you have engine problems.
If you get a warranty, just make sure it’s a factory warranty. Third party “extended warranties” are actually just “vehicle service agreements”; they don’t actually warrant quality or build.