We know that $R={\rho l/A}$ but how do you define L and A, Area of cross section? How do we define area of cross section of a conductor for resistance of a metal piece.
When you a wire which is generally cylindrical you have a length of it. Its area of cross section is a circle whose plane is perpendicular to the length of cylinder at any point.
But what if it take a very irregular shape which we would call as a piece not wire. How can i calculate its length and area of cross-section after taking any two point om its surface as end points.
Edit:
Think of a metal piece  which is irregular in shape with no flat surface(not sphere) and take two points A and B on it which are not the farthest point on it.
 A: For the formula to work, the conductor must be a (right) general cylinder. That is, its cross section must be the same at all points along its length.
Then the cross-sectional area is the same no matter which location along the length you choose to measure it at.
The cross sectional area is simply the actual cross-sectional area, regardless of how complex the shape of the cross-section is.
Of course if you were to talk about things like fractal shapes, with microscopic features, this model might break down if the features of the shape approach the size of the material's molecules (or even of the crystal grains, which are much bigger than single molecules).

How can i calculate its length and area of cross-section after taking any two point om its surface as end points.

For the formula to apply, you must apply the end voltages uniformly across the two end surfaces of the cylinder. You can't apply it at single points. However, the error from doing so will be very small if the length of the cylinder is much greater than the diameter of the cross-section.
If the conductor is not a proper cylinder, you'd have to find its resistance by a numerical calculation. You could either approximate its shape as a sequence of shorter cylinders, or you could do a full 3D finite element model of the whole shape.
A: Consider an object with an arbitrary cross sectional area $A$ (m$^2$) as shown below.

In this picture, the current flux $J_Q$ (C/m$^2$) for particles with charge $Q$ (C) is
$$ J_Q \equiv \frac{i_Q}{A} = \rho_{N,Q}\ \mu_Q\ Q\ \frac{dV}{dl} $$
where $i_Q$ is the current flow (A), $\rho_{N,Q}$ is the charge density (number/m$^3$), $\mu_Q$ is the carrier mobility (m$^2$/V s), and $dV/dl$ is the electrical field strength (V/m).
Rearrange the above to obtain the expression below.
$$ i = \int_0^L\ A\ \rho_{N,Q}\ \mu_Q\ Q\ \frac{dV}{dl} $$
We define $\rho$ as the resistivity $\rho^{-1} \equiv \rho_{N,Q}\ \mu_Q\ Q$. Assume that the only parameter that varies along the length is the cross sectional area. We obtain
$$  i = \frac{\Delta V}{\rho} \int_0^L\ \frac{A(l)}{dl} $$
The corresponding definition for resistance becomes
$$ R = \rho\ \int_0^L\ \frac{dl}{A(l)} $$
The above can be integrated analytically or numerically.
