Fiber endoscopy plays an important role in the clinical diagnosis and treatment processes involved in modern medicine. Thin fiber probes can relay information from confined places in the human body that are inaccessible for conventional bulky microscopes. Therefore, they can provide a minimally invasive platform for optical diagnosis assisting the fast recovery of patients. Aiming for more compact fiber endoscope devices, we investigate different types of fibers that can integrate not only superior imaging modalities but also microsurgery capabilities while maintaining an ultrathin size (less than 400um). In our experiments, the imaging potential of multimode and multicore fibers is assessed. On the one hand, multimode fibers provide high information capacity for small core sizes but scramble the input field after its propagation through the fiber length, while on the other hand, multicore fibers are the most common choice for endoscopic probes since they are able to directly relay images from the inspection location to the observation side. However, the final images produced by multicore fibers are of poor quality because of the discretization effect induced by the individual core sampling and the final resolution is related to the core spacing. We show that each fiber type can be selected based on the desired application and the imaging result can be significantly improved. Two approaches for imaging through the different fibers are investigated. In the first part of the present thesis, wavefront shaping using the transmission matrix approach to generate a focus spot at the distal fiber side is presented. The limitations concerning the maximum peak intensity guided through the different endoscopes is investigated for high power femtosecond pulses where nonlinear optical phenomena can hinder the overall performance of the system. Femtosecond laser ablation is demonstrated through multimode fibers for a range of materials. Furthermore, laser ablation is combined with two-photon fluorescence imaging in the same multimode fiber endoscope showing for the first time selective tissue modifications at a cellular level. In the second part of this thesis, deep learning of light propagation through the two fiber types is studied. Datasets of known input images and their respective fiber output images are generated to train deep neural network algorithms to map the fiber output to the fiber input for either classification or image reconstruction purposes. The deep neural networks show impressive performance to recover the information from intensity-only images of the speckle patterns emerging from multimode fibers, removing the need to record the full field information. Moreover, deep learning for multimode fiber imaging proved to be resilient to perturbations related to mechanical, thermal and even wavelength drifts introduced during the measurements. In the case of multicore fibers, deep neural networks are trained to remove pixelation artifacts from the final image and resolve features with an improved resolution. Finally, deep learning is employed to transform a bright field imaging-based commercial endoscope to a phase contrast imaging probe by training deep neural networks to map the intensity-only recorded image to its corresponding phase map.