We have mocap animations and when adding those animations to characters in unity their lower bodies get twisted like that. But when I import those animatinos to Blender to inspect they don't have such problem. Also I remember, we asked another person to look at these animatinos in another 3D software and he said, he saw errors in animatinos right away. I can't even see Them in Blender, and don't know where to look to solve this problem. Would be so thankful if anyone could give me directions. Thanks a lot.
Try applying your transforms before you export. Select the object then at the top of the viewport click Object button->Apply->All Transforms. Then export it. This solves a lot of Blender to Unity issues and is something you should normally do with exports.
If not that it also might be an armature pose issue between editing modes (Object mode of armature, edit mode, pose mode etc not set properly)
That looks like a missing root bone issue.
Many softwares require a root bone that you keep basically untouched at the world center. Since you didn't provide one, Unity decided to use your hips bone, messing up its animation.
Always provide a root bone at the world center with no animation, and who is the top parent of your bone hierarchy. It avoids many technical issues like this, and it is quite standard to also have offsets bones that are basically one or two bones duplicated from your root, which are below the root in the hierarchy but allows you to easily move your entire rig around.