This seems like a simple question that would be tempting to hand-wave away as a "Well you know..." but the more I think about it the less cut and dry it seems.
Some prompts to get you thinking
What are the merits and purposes of fun?
What makes something fun? Though different people find different things fun, is there a common thread that makes those things fun?
Is it easier for some kinds of people to have fun than others? What kinds of situations lend themselves to fun experiences, which make them difficult?
Are there ways for people who have forgotten how to have fun to "get back in touch with fun?"
Fun is a dopamine hit linked to some activity. It really is that straightforward.
Note, not all dopamine hits are fun, because it turns out that dopamine hits can be highly addictive (and indeed several game publishers ruthlessly exploit this flaw in human psychology). But all fun is dopamine hits. (Not only just dopamine hits, naturally. Many other hormones can be involved depending on the nature of fun: sexual activity generates dopamine but also oxytocin, for example.)
I think the question here would be "Is a dopamine hit both the necessary and sufficient condition of fun?" In other words, even if a dopamine hit is always part of fun, is that all it is? Why does it give us a dopamine hit? What behaviours is it encouraging and why?
The dopamine hit is absolutely necessary. It's the part that makes fun "feel good". As for the "why" and "what purpose", that's a field of active study as far as I can tell.
The release of dopamine from sex has obvious adaptive behaviour. If sex didn't feel good animals wouldn't do it. It's a lot of work, a lot of energy expended, and the process involves a lot of vulnerability. Absent the dopamine hit there would basically be no procreation and no species (or, rather, more accurately, the strains that didn't feel good from reproductive activity wouldn't reproduce and would choke themselves out of their genes' survival while those who enjoyed sex would pass their genes on). The release of oxytocin during procreative activity is similarly adaptive. It is quite literally the foundation of society.
The release of dopamine on any successful action is a reward that encourages repeated behaviours. Pre-civilization it was likely, I would guess (I'm not an evolutionary biologist, just an intrigued layperson), the way that we learned things. Figuring out how to do something feels good so we do more of it. Succeeding at a physical feat feels good so we do more of it. Back when we were basically at the mercy of nature this was clearly adaptive behaviour. It's only when the continuous safety of civilization started to let us tinker with that reward cycle that maladaptive things (like gambling, say, or obsessive behaviour) started to really crop up. And now with the Innarwebtubes and cynical corporate manipulations that dopamine hit is weaponized against us.