To change pin in PSA BSI, i think you have to virgin your eeprom dump then recode with pps/lexia (Coding + Immo adaptation(PIN) + Key learning)
or
You can clone your BSI with smok, avdi or ioterminal (Read FLASH and EEPROM in old bsi , write them in donor) (not all bsi are supported)
sometimes need to key learning after cloning
SMOK is very good tool (you have to spend money for it)
i don’t recommend eeprom swapping , works for old bsi but on others strange behavior
For VAG
you can change pin in dash – ECU (adaptation with VCDS Immo2 – Immo3(no sure))
from Immo3+(Dash) / Immo 4(Dash) / Immo 5 (cars with key in BCM2)
you have to adapt with CS , MAC , PIN , POWER CLASS in the donor DASH – ECU (not Immo 5)
VVDI , AVDI , SMOK good tool for the job
hope you find some help in my answer
Best Regards
Credits to @ runtronics974 (DK member)