I have a rigid body whose centre of mass is located at position p relative to origin of fixed global reference frame. ux,uy and uz are three orthogonal unit vectors relative to origin of the fixed global reference frame. These unit vectors represent the local coordinate frame of the rigid body. The local coordinate frame follows linear and rotational motion of the rigid body.
How can I build an initial quaternion for this rigid body in its current orientation ?
"ux,uy and uz are three orthogonal unit vectors relative to origin of the fixed global reference frame."
It is exactly the 3x3 rotation matrix. You can just convert from this 3x3 matrix to quaternion, using good known implementation.