Is there a way to enlarge a photo and not lose image quality
From a technical standpoint, no. If you start with a photo 100px square, and want to enlarge it to 400px square, 150,000 pixels have to be created out of thin air to make up the difference.
That said, some software is better at doing this than other software. There are plugins for software like Photoshop as well as stand-alone apps that use fractals to better guesstimate the missing pixels.
That said, enlarging a photo 4x (just as an example) is going to be really hard to do without some significant loss in quality.
Quality is a process. Either you mantain quality on the process or not.
Enlarge is relative. You can enlarge a good quality photo to be viewed across the street and if you can mantain a process, you could say you did not loose quality, you simply enlarged the image for that usage.
Some types of photos, for example inorganic geometric shapes, like a still life or a glass building can be "resampled" (which is not the same as enlarge) with some programs like. Genuine fractals, PhotoZoom or Reshade.
Do not trust blindly to the promises of "super resampe" but you can, if you need a resampling of 200% to difuse some evident pixels on your project.