A B Major 6 (B6) chord contains the notes B, F#, D#, G#. It is built from the major 6th formula 1 - 3 - 5 - 6, with B as the root.
Can B6 replace B major in a progression?
Usually yes, and often to good effect. The 6th adds warmth without the pull of a 7th, so a V chord built this way still leads home but sounds less urgent about it. Where it doesn't work is a hard blues or rock cadence that needs the dominant's edge — there, B7 is the chord you want.