How to fix one axis in rigid bodies?

I'm creating a 2D physics game. Is there any way to lock one axis in translate and two in rotation in rigidBodies?

Yes, these are some of the things that Configurable Joints are designed to do.

Have a read of that manual page and see how you get on. If you need to narrow down your question to more specific details, you could come back here and add some detail to your question using the 'edit' option.

Configurable joints can be set up and used entirely via the editor, or you can choose to create and manipulate them via scripting (Configurable Joint Scripting Reference).