We use the Green's tensor technique to study the optical processes taking place in configurations typically used for the replication and characterization of nanostructures. For the replication process we investigate light-coupling masks for optical contact lithography and for the characterization process the mode scattered by a defect or a short grating in a planar waveguide. Both configurations consist of structures embedded in a stratified background composed of a stack of material layers with different permittivities. We perform calculations for two-dimensional and three-dimensional structures and compare their optical behavior. Our results show that the additional material interfaces in three-dimensional systems can lead to significantly different field distributions and must be taken into account for a complete understanding of the electromagnetic properties of the systems.