I don’t think there’s anything specific you’d have to do to get invited. I invite my friends often enough, for no real reason. It’s never anything formal. But if we’re not friends, I probably wouldn’t invite you, don’t take it personally.
On the other hand, my “dinners” are just a buncha people getting together over here, then I order a whole buncha pizzas and we watch movies all night.
We usually don’t even make it to the kitchen haha.