Perhaps.
If you are putting a running XP onto this drive then the two computer motherboards need to be similar or fairly similar for what you want to do to work.
If they aren't XP will moan and crash on you.
If you are intending to just install DOS on this USB drive and then place the XP install files on it as well for installation on this drive once transferred across to the other computer then this will work.