I would like to know if it is allowed to partially touch/cross the bounding box of an AWG for example with a waveguide in an attempt to make my design more compact. Thank you.
You are probably referring to a PDK or library building block type cell. You would have to apply whatever layout rules are defined by the maker or provider of the block. If the cell’s content is replaced at the foundry, then you very typically should not cross the bounding box, as what looks empty in your view, may have (unexpected) content after replacement.