On a brick, block or other masonry chimney we actually cut into the masonry leaving a small crack where we can put our custom bent trim into the crack so it naturally seals tightly.
On Steel walled chimney pipes we use our roofing boot.