Is this possible in Ue4?

You can attach a weapon to the character skeleton using a socket. The weapon itself can be another skeletal mesh with its own bone hierarchy. You can see an example in the learn tab Shooter Demo.