Ballistic Weave

The ballistic weave is an armor mod that allows adding defensive stats to certain clothing items, including outfits, clothing that can be worn under armor, and a small number of hats.

This crafting ability can be learned from Tinker Tom after performing certain quests for the Railroad faction. Once this skill is learned, one can upgrade any applicable clothing item at an armor workbench.

Obtaining the skill
Progress through the initial Railroad faction quests until P.A.M. offers a series of minor Jackpot missions to secure DIA caches. These only become available after completing Boston After Dark and Mercer Safehouse.

After completing the first jackpot mission, Drummer Boy will tell the Sole Survivor that they need to speak to Tinker Tom, who will inform them about the old ballistic fiber technology found in the DIA cache. At this point the ballistic weave is unlocked at any armor workbench and Tom will sell some armored gear of his own.
 * Many people, including myself, did not get ballistic weave from the first jackpot mission. I got mine on the second.

Upgradable clothing
The following is a list of all clothing items that can be upgraded, and if the item can be worn underneath armor pieces.

Upgradable hats

 * Battered fedora
 * Green rag hat
 * Newsboy cap
 * Trilby hat

Bugs
Aggravating the Railroad or choosing the procrastinate dialog option (left) with PAM or Tinker Tom may cause the NPCs to become bugged and respectively not give the quest or unlock the ability to mod apparel.