How is Maxwell's second equation true here? $\vec{B}=\nabla \times \vec{A}\tag1$
This is true because at every point $\nabla\cdot\vec{B}=0 \tag2$
In free space points,
$\displaystyle \vec{B}=\dfrac{\mu_0}{4 \pi}\int_C \dfrac{I\ dl \times\hat{r}}{r^2}\tag3$
Consequently: $\nabla \cdot\vec{B}=0 \tag2$
At the points on the circuit, there is a singularity and we cannot directly apply equation $(3)$, i.e. Biot Savart law.
So in this case how can $\nabla \cdot\vec{B}=0 $

Edit (My understanding) @ garyp:
$\text{I am a graduate student. So I may seem to be a bit naive. Anyway please tell whether}\\ \text{I am understanding in the right way.}$
Here I am not considering the circuit as three dimensional.
By considering it as one dimensional, the (closed) circuit becomes equivalent to a magnetic dipole layer of infinitesimal thickness.

By using inverse square law of magnetic poles, we can find magnetic field (intensity) at any point outside the magnetic dipole layer (even at points infinitely close to the dipole layer). Let's first see the magnetic field due to an element of dipole layer at a point infinitely close to it:
$$\vec{B}=\mu_0\vec{H}=  k \ M\  \left[    \dfrac{\hat{r_1}}{r_1^2}-\dfrac{\hat{r_2}}{r_2^2}      \right]  dS'$$
(where $M$ is magnetic pole density and $S'$ is the surface of magnetic dipole layer)
Now making use of divergence formula in spherical coordinates:
\begin{align}
\nabla \cdot \vec{B}
&= k \ M\  \left[  \nabla \cdot  \dfrac{\hat{r_1}}{r_1^2}-\nabla \cdot  \dfrac{\hat{r_2}}{r_2^2}      \right]\ dS' \\
& = \lim_{r\to\ 0} k \ M\    \left \{
\left[   \dfrac{1}{r^2}     \dfrac{\partial   \left(   r^2 \dfrac{\hat{r}}{r^2}  \right)}{\partial r}   \right]_{\text{at }r_1}
-\left[   \dfrac{1}{r^2}     \dfrac{\partial   \left(   r^2 \dfrac{\hat{r}}{r^2}  \right)}{\partial r}   \right]_{\text{at }r_2}
\right \} dS' \\
\text{We see the two $r^2$ cancel out} \\
& = \lim_{r\to\ 0} k \ M\   \left[ 
\left[   \dfrac{1}{r^2} \dfrac{\partial \hat{r}}{\partial r}   \right]_{\text{at } r_1}  -  \left[   \dfrac{1}{r^2} \dfrac{\partial \hat{r}}{\partial r}   \right]_{\text{at } r_2} \right] dS'\\
& =0\\
\text{(This is because $\dfrac{\partial \hat{r}}{\partial r}=0$)}
\end{align}
Therefore the divergence (at points outside the dipole layer) due to each of the elements of dipole layer is zero. That is, the divergence (at points outside the dipole layer) due to the magnetic dipole layer is zero.
Thus we see that the magnetic field may blow up at points infinitely close to the dipole layer but its divergence will still be zero.
Thus the divergence of magnetic field due to (closed) circuit is zero everywhere except at points on the (closed) circuit. Now comes the key point: Since we know the divergence of magnetic field due to a (closed) circuit, even at points infinitely close to the circuit, is zero we ignore the circuit and say $\nabla \cdot \vec{B}=0$ everywhere on $\mathbb R^3$.

 A: A singularity will appear only if you model the wire has having zero thickness.  That's often fine, and in such a case you wouldn't care about the magnetic field within the wire as it has no inside.  
If you want to find the magnetic field within the wire, you would model the wire as having a finite diameter and having a specified current density distribution.  With that, there would be no singularity.
You have one of two situations:  a singularity that you don't care about, or a thick wire having no singularity.
A: Total magnetic field is not defined on a current carrying line, but its divergence is, and it is equal to 0 in distributional sense.
The reason is, magnetic field has to obey Gauss' law
$$
\int_{\partial V} d\mathbf S \cdot \mathbf B = 0~~~\text{for any volume element }\Delta V
$$
and also
$$
\int_V \text{div}~\mathbf B ~dV = 0~~~\text{for any volume element }\Delta V.
$$
This means that $\text{div}~\mathbf B$ is a distribution that is equivalent to 0 everywhere. One could suppose $\text{div}~\mathbf B$ is zero only outside the current line but has finite value on the current line, but that would not have any effect on these integrals. One cannot suppose that $\text{div}~\mathbf B$ has some delta distribution component on the current line, because that would change those integrals. So the simplest and most natural choice is to assume that divergence is zero everywhere.
