Yes, and it is one of the most common configurations, but the host building has to be checked first.
An attached canopy can affect the structure it connects to, so the existing frame, foundations and cladding must be assessed before design. Where the existing building cannot support the proposed arrangement, a freestanding canopy alongside it may be more appropriate.
The tie-in detail matters as much as the load. Where the new roof meets the existing wall or roofline, the junction has to shed water positively and allow for movement between two structures that will not settle identically. Done badly, that junction is where the leak appears.
There is a practical reason to consider free-standing even where attachment is possible. A free-standing canopy can be relocated later. An attached one is effectively committed to that building.
Send us photographs of the elevation you want to build against, along with anything you have on the existing structure, and we will tell you which route makes sense.