Evolutionary models of massive stars predict a surface enrichment of nitrogen, due to rotational mixing. Recent studies within the VLT-FLAMES survey of massive stars have challenged (part of) these predictions. Such systematic determinations of nitrogen abundances, however, have been mostly performed only for cooler (B-type) objects. For the most massive and hottest stars, corresponding results are scarce. This is the first paper in a series dealing with optical nitrogen spectroscopy of O-type stars, aiming at the analysis of nitrogen abundances for stellar samples of significant size, to place further constraints on the early evolution of massive stars. Here we concentrate on the formation of the optical NIII lines at λλ4634-4640-4642 that are fundamental for the definition of the different morphological ``f''-classes. We implement a new nitrogen model atom into the NLTE atmosphere/spectrum synthesis code fastwind, and compare the resulting optical NIII spectra with other predictions, mostly from the seminal work by Mihalas & Hummer (1973ApJ...179..827M
, ``MH''), and from the alternative code cmfgen. Using similar model atmospheres as MH (not blanketed and wind-free), we are able to reproduce their results, in particular the optical triplet emission lines. According to MH, these should be strongly related to dielectronic recombination and the drain by certain two-electron transitions. However, using realistic, fully line-blanketed atmospheres at solar abundances, the key role of the dielectronic recombinations controlling these emission features is superseded - for O-star conditions - by the strength of the stellar wind and metallicity. Thus, in the case of wind-free (weak wind) models, the resulting lower ionizing EUV-fluxes severely suppress the emission. As the mass loss rate is increased, pumping through the NIII resonance line(s) in the presence of a near-photospheric velocity field (i.e., the Swings-mechanism) results in a net optical triplet line emission. A comparison with results from cmfgen is mostly satisfactory, except for the range 30000K≤Teff
≤35000K, where cmfgen triggers the triplet emission at lower Teff
than fastwind. This effect could be traced down to line overlap effects between the Niii and Oiii resonance lines that cannot be simulated by fastwind so far, due to the lack of a detailed Oiii model atom. Since the efficiency of dielectronic recombination and ``two electron drain'' strongly depends on the degree of line-blanketing/-blocking, we predict the emission to become stronger in a metal-poor environment, though lower wind-strengths and nitrogen abundances might counteract this effect. Weak winded stars (if existent in the decisive parameter range) should display less triplet emission than their counterparts with ``normal'' winds.