Sugar or jaggery works
If the dosa batter or idli batter becomes too sour, you can use sugar or jaggery. These reduce the sourness. They also enhance the taste. But you have to be careful about the quantity, as excess quantity will spoil the taste of dosa and idli. So first add a little sugar or jaggery and taste it. If it feels less, add more sugar or jaggery and use it.