Let's say that I have an iMac with a wired Ethernet connection and a WiFi connection at same time, on two separated LAN. Is this possible to ask Firefox to use the WiFi and Safari to use the Ethernet wire card ?
Yes - browsers are a special case in that they allow you to choose a proxy to access the internet. This doesn't over-ride the default route by itself as you will need to set up a web proxy with a known address.
Another option would be to install a second OS in a virtualization container and letting that OS see the alternate interface. This would be a great solution if you have a speedy mac with plenty of RAM.
Back to (ab)using the proxy settings to work around the network splitting...
Assuming you are OK doing that, then you would use the
This assumes you have basic network knowledge and basic command line knowledge. Once it works, you could automate things - but it gets complicated quite quickly. It is possible with some specialized knowledge, but not something you can click a button or two and have traffic from any app ignore the default routing that the system is using.
You may not be able to do this at the application level (firefox, safari, chrome, etc)..but you can do this at the ip layer. You can add specific routes and secondary gateways to your networking configuration, but this won't be determined by the browser, it will be determined by the the IP incoming/outgoing and pick a network card after that.