衙 appears almost only in 衙门 (yamen), the office of a government official in imperial China. The word is now historical or used figuratively for a bureaucratic, hard-to-deal-with office.
The 行 element wraps around the outside as the indexing radical, its strokes split on the left and right of the inner part, framing the official compound one walks into.