All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
If a person knows for a fact that there are some pieces of pork in soap or toothpaste, then it is not permissible for him to use it because what is taken from pig is impure whether it is taken from a live pig or a dead one. Using impurities or a product mixed with impurities is forbidden.
Allah knows best.