Nitrogen is more electronegative than hydrogen hence N will pull electrons towards itself. Hence not a good candidate to donate electrons!
Yet it makes bonds with hydrogen, as do other electronegative elements (think of hydrogen chloride and water). So polar bonds form in all kind of molecules.
lets take the case of Oxygen O=O, here each Oxygen atom has 2 lone pairs, and going by the above logic these lone pairs should also participate in bond formation and create an Oxygen polymer(!!)
The concept of stability makes sense when comparing two states with the same number of atoms (e.g. ammonia and hydrogen ion vs. ammonium ion). For elemental oxygen to polymerize, each $\ce{O2}$ molecule would bring in electrons. For a molecule to act as base, a lone pair turns into a bond with hydrogen (where hydrogen provides zero electrons and the base provides two). This does not "break the octet" of the base, and give the hydrogen access to two electrons (completing its duet).
Hence with the above points I still could not see why Nitrogen has to accept proton
It does not have to. It is a weak base. If you add ammonia to neutral water, most of it remains undissociated (the pH goes up, though, because some of it does dissociate).
[devils advocate question:] How can I use electronegativity to predict something about acid/base chemistry?
The trick is to compare green apples with red apples, not oranges with bananas. The easiest comparison is isoelectronic species, such as:
$$\ce{HF vs OH-}$$
Hydroxide is a better base than hydrogen fluoride.
$$\ce{H2O vs NH2-}$$
Azanide (had to look up the name) is a better base than water.
$$\ce{H3O+ vs NH3 vs CH3-}$$
The methyl anion is a better base than ammmonia, which is a better base than hydronium.
Or you can compare compounds by exchanging O for NH or CH2.
$$\ce{H2O vs NH3 vs CH4}$$
$$\ce{CH3-OH vs CH3-NH2 vs CH3-CH3}$$
$$\ce{CH2=O vs CH2=NH vs CH2=CH2}$$
This is more complicated because the carbon atoms lack a lone pair while nitrogen and oxygen have one. So you can compare nitrogen and oxygen using an electronegativity argument, but have to exclude carbon because it can't act as a base without the lone pair (well, $\ce{CH5+}$ does sort of exist but is called a super-acid, so $\ce{CH4}$ is hardly a base).
Hydrides
Here is a set of examples from OpenStax Chemistry 2e showing some of the trends across the periodic table. Again, $\ce{CH4 and SiH4}$ don't have lone pairs, so they can't be bases, even though the trend suggests they might be the strongest base in the series. The reason that water is described as neutral is not some special property of water but because the pKa is typically defined in aqueous solution, and a neutral pH references the hydroxide and hydronium concentration in pure water. If liquid ammonia were our solvent of choice, that would be the "neutral" case.