Downlighters with transformers perform fine when fixed switches are used, but when fixed switch is replaced by dimmer switch, lights flicker every few minutes or dim for a couple of minutes then brighten again without using the dimmer switch. Are downlights compatible with dimming function?

Simple answer no. But not because they will not work. They will if the transformer (inverter) is designed to work with dimmers and is matched to dimming switch (Leading or lagging).

However the way that the quartz tungsten halogen lamp works is that the quartz envelope is so hot the tungsten will not migrate to the envelope but returns to the element. In time the element thickness to vary too much and it will blow but because the active tungsten goes around in circles the time is reasonably long.

If you run the envelope too cool however the the tungsten will settle on the quartz and it will go black and fail.

Cold cathode lamps and LED lamps also have problems with dimming so again will not really work.

There are exceptions to every rule and there are some special discharge lamps that can be dimmed but not standard types.

So to re-cap if the switch and inverter are matched you can dim lights but if you do lamp life will be much reduced.

Normal method is 1/3 and 2/3 split so either 1/3 of lamps used or 2/3 of lamps used or all giving three stages of lighting. But the angle of the beams needs to be wide. The standard small spot comes from 6 degs to 60 degs spread and cold cathode even wider and one does have to be careful to replace like with like.