I do not know what the text was on the invitation and what was exactly known about the event.
But to me, you can always ask. If the host says no, you have to accept that.
For all we know, it is a bit more a casual event, or maybe the OP normally doesn't mind extra guests, or whatever, and the answer could be yes.
One of the most annoying things in life is not ask something and then afterwards hear 'oh, you should have just asked'.
If you do not ask, you make an assumption that it's rude, an inconvenience, or that you will make a fool out of yourself, or whatever reason you can come up with. This doesn't necessarily have to be the case.
Where I come from if you have a graduation party at all, it's a very informal event. As it's usually summer after graduation, think events like a garden party, a casual BBQ. Those type of things.
To have a formal pay-per-head event, would not something that pops in my mind when someone invites me for a graduation party.