Hi Tina, both sentences are perfectly correct.
Spanish is a rich language with many tenses and each of them offers different nuances.
The difference between the two sentences is:
♦ In the first one there is uncertainty we even propose to him to come.
♦ While in the second one assumes that he's going to be invited or he's already been invited to this party. Although there is still uncertainty that he will come.
1. Dudo que Juan viniera a la fiesta → I doubt that John came to the party.
☛ In the hypothetical case that we or someone would offer to him.
2. Dudo que Juan venga a la fiesta → I doubt that John comes to the party -in the future-)
☛ If we or someone offer it, or even if we've already proposed it to him.
I really hope this helps you, Tina. Kindest regards.