Yes, both can be used for each other, but it's not advisable.
A comparator is specifically designed with very very high gain, and is also designed to provide a fast and "clean" transition. If you used it as an op-amp, the results are unpredictable, but most likely it will somewhat work. Since the ouput transistors are not designed to operate in the active (linear) region, the chip may overheat.
An op-amp can be used as a comparator easily. Again, you may not gat the fast and clean transition (may oscillate). That being said, I've used op-amps as comparators, but, I always provide for some positive feedback (schmitt trigger circuit) and it works fine.
Jim