if the hub is aluminum and the cog is steel, which is by far the most likely, your friend can certainly hit it with a welding torch and some filler. it would probably affix the cog to the hub in some capacity, but it wouldn't be "welded" since
afaik steel and aluminum will not coalesce using standard equipment and procedures.
if you're set on this, consider seeking out an aluminum cog. that'll probably work better. no matter what you do keep a brake.
edit: i'll go ahead and be that guy that reminds you that you can get a track hub + peace of mind for
less than forty bucks (and less than that if you do some homework and are patient)