I have already signed an agreement for a postdoctoral contract. Now I got an interview call after getting the first contract, which I have signed to join. Can I appear for that interview? Is it possible to navigate the first one somehow, if I get the second position?
No, it's not ethical. You already accepted one job. Other candidates are informed that they are not successful and move on. If you intend to leave this job now, you are compromising the project of PI who hired you, as they won't be able to quickly hire another postdoc. If you are not going to take the second post, you are wasting time and effort of the interview panel without a good reason.
If you inform the second place about the situation and they agree to have the interview then it should be fine. If they are paying for travel they might want to cancel, of course. But you should also be clear that the interview can't lead to employment in the short term as you have an accepted offer for the next x years.
But, since a postdoc isn't a permanent position, you might want to keep your options open for the future and if they are interested enough in you to wait, then it might work out.
Just be honest with people. If you follow the above suggestion then you wouldn't (IMO) even need to inform the place at which you have accepted the offer.
There might be other situations in which such a thing is proper, such as a tentative offer/acceptance that isn't yet formalized but I wouldn't advise trying to break a valid contract, even for a better offer now.
It is ethical as long as the contract you signed is not 100% legally binding for both sides. Or if you believe that it might not happen even though it is legally binding (say someone signed a legally binding contract to hire you, but doesn't have the money to pay you).
It is always legal to go to the interview, unless you signed a contract that doesn't allow it. Like "We pay you $X to take the job. We pay you 20% more if you cancel all future interviews right now"; that's unlikely to happen. Signing two contracts will of course cause you problems, but even the signing is legal. You will just be very likely in breach of at least one contract, so it will be a very very bad idea.
A lot of people will tell you "no it is not ethical" or "no it is illegal", truth is that the majority of the employment contracts includes a trial-period, both sides.
If it is your case too, you are all set.
This mean that you can decide any time, during the first days/weeks/months, to leave an employment. For whatever reason. And the reason "I found better working conditions somewhere else" is very real and very rational, if someone get offended because of that, someone is not a very human person.
Said all this, if you resign during the trial period and you start immediately afterwards at the second institution, you are clearly burning some bridges with the people that offered you a postdoc first.
C'est la vie, you cannot be friend of everyone.
ps: the resistance of science&academia people to interpreting and understanding that a contract is "an agreement to work together (often temporarily)" and not "a concession from some superior kin person to provide you some money for the privilege of working with them" is appalling. Sure, position in research&academia are scarce, but come on!