You can attend as many Masses on Sunday as you like, but you're only supposed to receive Holy Communion once in a day.
You can receive the Eucharist twice in one day if the second time is at a mass and not a communion service:
Can. 917
A person who has already received the Most Holy Eucharist can receive it a second time on the same day only within the eucharistic celebration in which the person participates, without prejudice to the prescript of can. 921, §2.
Canon 921 refers to Viaticum. It is possible that you go to two masses in one day, then are in a situation to receive Viaticum, and that is allowed. It's the only way you can receive the Eucharist 3 times in one 24 hour period!