I think this is a regional difference. In Portugal I would talk about "massa" as both what we call pasta in English and what we call dough or any sort of amorphous thing (like wet cement). I have not heard "macarrão" as pasta but I would not be surprised if that is a Brazilian term from Italian immigrants bringing over macaroni. Sidebar: One of the things that I have learned is that English is really strange. Yes there is variance but especially in the US regional dialects are more quaint than problematic. Even after several years I still have some problems understanding some of the Brazilian and European accents.
The difference is subtle and a bit of context, like the difference between say were and where. There is a difference in pronunciation but for the most part it is context that allows the listener to know the difference. Also there is training involved, if you listen to actual dialogue it takes about a month or so to train your ear.