We present a 2D study of the internal extinction on (sub)kiloparsec scales of a sample of local (z < 0.1) LIRGs (10) and ULIRGs (7), based on near-infrared Pa alpha, Br gamma and Br gamma line ratios, obtained with VLT-SINFONI integral-field spectroscopy (IFS). The 2D extinction (A(V)) distributions of the objects, map regions of similar to 3 x 3 kpc (LIRGs) and similar to 12 x 12 kpc (ULIRGs), with average angular resolutions (FWHM) of similar to 0.2 kpc and similar to 0.9 kpc, respectively. The individual A(V) galaxy distributions indicate a very clumpy dust structure already on sub-kiloparsec scales, with values (per spaxel) ranging from A(V) similar to 1 to 20 mag in LIRGs, and from A(V) similar to 2 to 15 mag in ULIRGs. As a class, the median values of the distributions are A(V) = 5.3 mag and A(V) = 6.5 mag for the LIRG and ULIRG subsamples, respectively. In similar to 70% of the objects, the extinction peaks at the nucleus with values ranging from A(V) similar to 3 to 17 mag. Within each galaxy, the A(V) radial profile shows a mild decrement in LIRGs within the inner 2 kpc radius, while the same radial variation is not detected in ULIRGs, likely because of the lower linear scale resolution of the observations at the distance of ULIRGs. We evaluated the effects of the galaxy distance in the measurements of the extinction as a function of the linear scale (in kpc) of the spaxel (i.e. due to the limited angular resolution of the observations). If the distribution of the gas/dust and star-forming regions in local LIRGs (63 Mpc, 40 pc/spaxel on average) is the same for galaxies at greater distances, the observed median A(V) values based on emission line ratios would be a factor similar to 0.8 lower at the average distance of our ULIRG sample (328 Mpc, 0.2 kpc/spaxel), and a factor similar to 0.67 for galaxies located at distances of more than 800 Mpc (0.4 kpc/spaxel). This distance effect would have implications for deriving the intrinsic extinction in high-z star-forming galaxies and for subsequent properties such as star formation rate, star formation surface density, and KS- law, based on H alpha line fluxes. If local LIRGs are analogues of the main-sequence star-forming galaxies at cosmological distances, the extinction values (A(V)) derived from the observed emission lines in these high-z sources would need to be increased by a factor 1.4 on average.