This is something that is asked a lot and usually gets people into a costly bit of trouble.
You need to know exactly how the brake is attached before you begin and sometimes this is not readily apparent. It could be welded, blind pinned or silver soldered or some combination of these methods. Welding or silver solder will give you trouble. Even done "cleanly" the barrel will be damaged. At best, very best, you will need to chase the threads.
IMHO, it's always better to sell the unwanted barrel with the brake untouched. There's always someone out there that wants it. Then buy a new barrel. Barrels are not very expensive, not much more than having the brake removed professionally and you have a brand new barrel, not the same used barrel you started with. Why pour repair money into a used barrel?