What is the pH of a solution of HCOONa and HNO3? Calculate the pH of an aqueous solution obtained by mixing 
  20 ml of $\ce{HCOONa}$ 0,1 M and 5 ml of $\ce{HNO_3}$ 0.2 M.
  ($K_\mathrm a$ of $\ce{HCOOH}$ $= 10^{-4}$)


My try:

The number of the moles involved are: $n_{\ce{HCOONa}}=0.002~\mathrm{mol}$, $n_{\ce{HNO3}} = 0.001~\mathrm{mol}$.
We have the reaction:

$$\ce{HCOONa + HNO3 -&gt; HCOOH + NaNO3}$$

Where 0.001 moles of $\ce{HNO3}$ si is consumed by reacting with 0.001 moles of $\ce{HCOONa}$ giving 0.001 moles of $\ce{HCOOH}$. Because remains $0.002\ \mathrm{mol}-0.001\ \mathrm{mol}=0.001~\mathrm{mol}$ of $\ce{HCOONa}$, we'll have a buffer solution with the acid $\ce{HCOOH}$.

It'll start the reaction:

$$\ce{HCOOH + H2O &lt;=&gt; HCOO- + H3O+}$$ 

Where the initial concentration of $\ce{HCOO-}$ is equal to $\ce{HCOONa}$ and is $\frac{0.001~\mathrm{mol}}{(0.02+0.005)~\mathrm l} = 0.04~\mathrm{mol~l^{-1}}$. So we have, 

$$[\ce{H3O+}]=K_\mathrm a \frac{[\ce{HCOO-}]}{[\ce{HCOOH}]} \Rightarrow \mathrm{pH} = \mathrm pK_\mathrm a - \log_{10}{\frac{[\ce{HCOO-}]}{[\ce{HCOOH}]}} = \mathrm pK_\mathrm a = 4$$

Is it correct?
Yes. You could also put the molar ratio into the equation for calculating pH (then you didn't need to calculate the concentrations).

And those are not initial concentrations, but equilibrium concentrations.