In the book Introduction to Topological Manifolds by Lee, Theorem $10.16$ says that
Let $M$ be a topological space with a polytonal representation $$ \langle a_1, a_2, \dots, a_n \mid W \rangle, $$ with one face, in which all vertices are identified to a single point, then $\pi_1(M)$ has the presentation $$ \langle a_1, a_2, \dots, a_n \mid W \rangle. $$
I was wondering about the fundamental group of the following space.
Take an $n$-sided polygon $P_n$. Identify all its vertices to a point. What would be its fundamental group?
I would proceed as follows. Choose any point $a\in P$, and consider a neighborhood $U$. Now consider $V = P_n - \{a\}$, then application of Van Kampen yields the fundamental group to be $$ \pi_1(P_n) = \{a_1, a_2, a_3, \dots, a_n \mid a_1 a_2 a_3 \cdots a_n = 1 \}. $$
Is this correct? What does the theorem say, I cannot relate with this example.
This is indeed correct. Here's an explanation.
In order to not confuse the original polygon $P_n$ with the quotient space obtained by identifying the vertices of $P_n$ to a single point, I am going to use $Q_n$ to denote that quotient space.
The relator $a_1a_2a_3...a_n=1$ can be rewritten $a_n = a_{n-1}^{-1} ... a_3^{-1} a_2^{-1} a_1^{-1}$. Using that relator, you can eliminate $a_n$ from the generating set and also eliminate the relator, to get the following presentation with no relators at all $$\pi_1(Q_n) = \{a_1,a_2,a_3,...,a_{n-1}\,\, | \quad \} $$ What this says is that $\pi_1(Q_n)$ is a free group of rank $n-1$, with free basis $a_1,a_2,a_3,....,a_{n-1}$. You can also verify this by constructing a deformation retraction from $Q_n$ to the union of $n-1$ loops, represented as the image under the quotient map $P_n \mapsto Q_n$ of the first $n-1$ sides of the polygon $P_n$.
By the way, one slight correction: in order for your method to work the chosen point which you have denoted $a$ should be chosen in the interior of the polygon.