Don’t quite understand what you mean. Are you trying to bury the whole length of the pipe I.e parallel to the wall and run it to the main sewer?
Regardless; excavation next to foundations:
It will depend on numerous factors not limited to the age of the property, depth and type of foundations and generally size of excavation.
Generally in a situation when a property is built on a tradition concrete strip footing provided that the excavation does not undermine the base of the footing or expose a significant length of the side of the footing it is likely that you will not structurally compromise the integrity of your foundations.
Ideally it’s worth digging a trial pit and identifying the depth and shape of your foundation. You can then either ensure your trench is excavated at a level above the base of the foundation formation level such that you won’t undermine the soil the the foundation sits on.
If you are digging a trench I would recommend excavation in sections, laid that section of pipe, back fill and compact prior to excavation of the next section of trench.
If it’s a single small hole you are digging then you can pretty much do what you like.