Small dog, big ego! He doesn't care if he is a fifth of the size of the Rottie or Doberman he will still go for them.
I have two terriers and one of them was just like yours. He would lunge at any dog, teeth showing snarling, growling, terrible noise. I also noticed that he was worse on the lead when he couldn't get to them. However, the more we walked him in social situations like the park or the woods, the better he became, we met with lots of different dogs. I also took him to a friend of ours who has a Greyhound, very laid back but will not tolerate small yappy dogs. He put my little terrier in his place I can tell you. After that he was much better. We would walk with the greyhound as well which got him used to other dogs being around him. He is a different dog now. Off the lead as well, no trouble. Says hello then walks away.
I know that Chihuahua are notorious for this behaviour but I think with patience and "calm assertiveness" from you, I think he will overcome his behaviour.