The fireplace and chimney are visually inspected. Although much of the interior of the chimney are not visible during a home inspection other visible components are inspected such as. Mortar cap checking for cracks, missing equipment such as chimney cap,spark arrestor, damper clamp for fireplaces with gas logs, screens. Combustibles may be too close to fireplace openings, are the opening the right size, are the hearth extensions correct,  does your chimney extend at least two feet above the highest roof area within ten feet measuring horizontally from the chimney, and must extend three feet above the highest point of any roof penetration.  If buying a home with a fireplace I highly recommend having a chimney sweep. The reason is chimneys and fireplace maintenance is usually neglected by home owners and much of the interior is not visible during your home inspection. During the home inspection I will look down the chimney at the roof area looking for defects  and Creosote build up and as much as I can looking up for the inside of the fireplace. If the home owner has been burning wood in the fireplace over the years  and has not had any cleaning of the chimney performed than Creosote can build up inside your chimney. Creosote is highly flammable and it does not take much of a build up to create a potential fire hazard. If burning wood inside your fireplace you should have your chimney cleaned once a year to limit the risk of a chimney fire.There are many more things that need to be inspected this is just some of the areas and defects that can be discovered by your home inspector.