If I understand it right, you are asking how to extract bites of one bitmask and set it on the other, for example :
const uint mask = 0x000000FF; //single color mask
const uint aOff = 3 * 8; //offsets of colors from the end for ARGB
const uint rOff = 2 * 8;
const uint gOff = 1 * 8;
const uint bOff = 0 * 8;
uint pixel1 = 0xFFFF0000; //red in ARGB
uint pixel2 = 0x0;
pixel2 |= ((pixel1 & (mask << bOff)) >> bOff) << (3 * 8);//set b
pixel2 |= ((pixel1 & (mask << gOff)) >> gOff) << (2 * 8);//set g
pixel2 |= ((pixel1 & (mask << rOff)) >> rOff) << (1 * 8);//set r
pixel2 |= ((pixel1 & (mask << aOff)) >> aOff) << (0 * 8);//set a
first, you create appropriate mask (mask << bOff) by shifting single color mask to correct position (alternatively, because it is static value tied to source pixel format so you can pre-compute it), then you extract all bits of the color channel by pixel1 & mask and shift them to get the value value >> bOff. After that you shift the value to its correct position in BGRA8888 format value << (pos * 8) and last you or it with zeroed BGRA8888 pixed pixel2 |= shiftedValue.
You can skip some shifting if you know the formats in advance and hardcode it.