The obvious answer is yes, since any finite space $X$ is an example. But you might want to assume that $X$ is infinite, so I've prepared some proofs below. In the first part I describe the difficulties of the case of ZF, and in the second part I explain how there's no such infinite space in ZFC.
A Tychonoff space $X$ is called a $P$-space when every $G_\delta$-set is open.
I've replaced compact Hausdorff with compact Tychonoff, since I suspect that compact Hausdorff spaces might not have enough continuous functions in ZF, and that it's possible that maximal ideals are not even distinct. This is because ZF with countable choice is not enough to prove Urysohn's lemma.
- Let $X$ be a compact Tychonoff space. Then every prime ideal $P\subseteq C(X)$ is contained in a unique maximal ideal.
Proof: For $f\in C(X)$ let $Z(f) = \{x\in X : f(x) = 0\}$, $M_p = \{f\in C(X) : p\in Z(f)\}$ and $O_p = \{f\in C(X) : p\in\text{int}(Z(f))\}$. If $P\subseteq C(X)$ is a prime ideal, there is $p\in X$ such that $P\subseteq M_p$. Let $f\in O_p$, and find $g$ such that $g(x) = 0$ for $x\notin\text{int}(Z(f))$ and $g(p) = 1$. Then $fg = 0 \in P$ and $g\notin M_p$ so that $f\in P$. It follows that $O_p\subseteq P$. Suppose that $q\neq p$. Find $f\in C(X)$ such that $f(q)\neq 0$ and $f$ vanishes on a neighbourhood of $p$. Then $f\in O_p\setminus M_q$, and so $P\not\subseteq M_q$. $\square$
- Let $X$ be a compact Tychonoff space and every $O_p$ is an intersection of prime ideals. Then $X$ is a $P$-space iff every prime ideal of $C(X)$ is maximal.
Proof: If $X$ is a $P$-space, and $p\in X$, let $f\in M_p$ then $Z(f)$ is a $G_\delta$-set, and so open, and so $f\in O_p$. It follows that $O_p = M_p$. Now if $P$ is a prime ideal, it follows from the previous proof that there is $p\in X$ with $O_p\subseteq P\subseteq M_p$, and so $P = M_p$. Now conversely suppose every prime ideal is maximal. If $O_p\subsetneq M_p$, let $f\in M_p\setminus O_p$. Find a prime ideal $f\notin P$ with $O_p\subseteq P\subsetneq M_p$, then $P$ is prime but not maximal. $\square$
Now the issue here is that I don't know how to get rid of the assumption that $O_p$ is a intersection of prime ideals without assuming AC. Normally I'd prove it by the following argument: Since $f^n\in O_p$ implies $f\in O_p$, there exists a prime ideal $P$ with $O_p\subseteq P$ and $f\notin P$, but this uses Zorn's lemma.
- A compact Tychonoff $P$-space $X$ is Dedekind-finite.
Proof: Suppose otherwise, and take countably infinite $A\subseteq X$. Then $A$ is a closed copy of $\mathbb{N}$, which is impossible since that would imply it's compact. $\square$
In ZFC the situation is much easier, and arguments don't hinge on compactness:
A Tychonoff space $X$ is a $P$-space iff every prime ideal of $C(X)$ is maximal.
A Tychonoff space $X$ is a compact $P$-space iff $X$ is finite.
These results are in Rings of continuous functions by Gillman and Jerison, and are proven by essentially using the arguments laid out above.