Depends on the game, there are many alternitives. In both games, you can simply repair the unique weapon with its non-unique variant. If you have the PC version of the game, just bring up console, input player.srm, now the player repair menu will show up. Alternitively, you can use the console command "modav repair 100" then "srm" on any npc (even corpses). This allows them to have a 100 in Repair and brings up the Repair interface. However, you still have to pay them.
In Fallout 3, the only NPC that cannot be killed is Shrapnel in Rivet City so he will always be able to repair you weapons. If the Mothership Zeta add-on is installed, alien epoxy can be used on the currently equipped weapon, repairing it.
In Fallout: New Vegas, in the Old World Blues add-on, the SCIU cannot be killed and Repairs to 100%. However, it does make you pay for these repairs. With the Lonesome Road add-on, ED-E can be upgraded to repair you weapons once a day, so equip the desired weapon, ask him to repair it, wait 24 hours and repeat until the weapon is at maximum condition. Additionally, weapon repair kits can be bought found and even made a workbench. Alternitively, the Jury Rigging perk allows you to repair all weapons with basic variants. For example, you can repair the unique super sledge, Oh Baby! with a normal sledghammer or a thermic lance with a pool cue. However, you will need a Repair skill of at least 50 to make weapon repair kits and the Jury Rigging Perk requires that you have a Repair skill of 90.