can I use any OP AMP as buffer
As TEMLIB pointed out, a comparator is not an op-amp, even if it happens to be drawn as a triangle with with 2 inputs and one output.

A typical design for a comparator is an open drain comparator, which can be modeled like this:







simulate this circuit &ndash; Schematic created using CircuitLab

Here, OA1 is an ideal op-amp.
If you connect Vout to V-, you won't get a voltage follower.

Additionally, even if you stick to the world of "true op-amps", there are some restrictions on what op-amps you can use and how you use it. For example, some op-amps are not unity gain stable. Since a voltage follower has by definition a gain of one, trying to build a voltage follower with one of these will always be unstable, and you won't get the desired voltage follower behavior.

You could start with an advertised unity gain stable op-amp and drive it unstable by what you connect the output to and what input waveform you give to the op-amp. It is also possible to do the reverse and add components to stabilize an unstable configuration. There's a wide variety of literature available online on op amp stability.