Let me recommend the Wikipedia article on colour temperature but caution you that while that article is quite good, it says a few misleading things and, as usual, you might want to visit a library or do some more extensive online research.
If you want to learn the math of how color and temperature are correlated in thermal radiation, look at the excellent article on Wien's displacement law. (Spoiler: it's
peak wavelength of light = a constant / temperature or
peak frequency of light = a different but related constant * temperature)
1) If one object is appearing blue and other object red. That doesn't always mean blue object is hotter than red? Is that correct?
That is precisely correct. In fact, most colors we see around us in the normal course of life are not correlated with temperature in this way. Physicists have found that the spectrum of radiation emitted by an object is correlated with the temperature of the object. If the object is hot enough, it emits visible light. The color temperature we are talking about here is temperature at which a perfect (black) radiator would emit radiation of the same average frequency.
If yes then how is it so?
Most of the light we actually see around us is non-thermal; its color derives from differences in the properties of various materials. For example, the air molecules over our heads scatter blue light about eight times more readily than red light, so we see a strong blue color. To get light from a purely thermal source that was in some average sense "equally blue", you would have to heat that source to about four times the temperature of our Sun's photosphere.
The only thermal sources you see in everyday life are things like toaster wires or oven heating coils that get red-hot, the Sun and the fixed stars, and incandescent lights.
Anything you see by reflected light (including the planets and the Moon as well as most anything you see on Earth that isn't red hot or hotter), or scattered light (like the blue sky), or various kinds of non-thermal emission (lasers, LEDs, fluorescents, lightning). Even open flames – candlelight and firelight – are not thermal, a candle is no where near the thousands of degrees its color would seem to indicate; if you want to see how thermal colors work a good way is to watch glass blowers at work and look through the little window into their furnace.
If you use infrared cameras or goggles, you can see a representation of the thermal radiation from objects like people or trees or the warm exhaust from a vehicle. Look up "thermal imaging" in a search engine or a Library and you will find some pictures that show warm things as bright and cooler things darker. Remember the colors you see in such images are "false", you can't see those colors with your eyes, though you can feel them on your skin and some animals, like pit vipers, can "see" them directly with sense organs adapted to infrared light.
Confusingly, when people talk about "color temperature" they can mean several different things, especially:
the correlated color temperature (CCT)- that is, the temperature a blackbody (perfect thermal radiator) would need to be heated to to emit light of the same average color.
Some kind of "perceived color temperature" that varies depending on who is doing the color/temperature mapping. Usually this seems to run backwards from the CCT, so that red and orange are "hot" colors and blue, purple, and green are called "cool" colors, but it need not be a simple backwards map; for example, red might be called 'warm', and orange "hot", then green is "cool", and blue "cold". There is no universal list of how people rank colors psychologically or artistically in terms of temperature, in fact according to visual designers there are "warm greys" and "cool greys" that would all not even fit on the CCT scale. This means that if you are reading a book and it talks about hot or cool colors, you may have no real way of knowing what kind of color it means unless you pick it up from context in that particular book.
Also, people see color very differently from a simple spectrum analyzer; our vision is highly background and history dependent. The very same frequency that appears yellow to us in one context might seem green or orange in another context: read up on "color perception" as a topic to learn more about this.
The sky appears blue, does that mean its hot?
No, your doubts here are well justified. Blue sky is not a thermal light source. In fact, assigning it a thermal temperature is a little disingenuous as there is another way to measure "the temperature of the sky" with a telescope that gives a much more sensible answer. (you point telescope at a patch of sky and put a sort of thermometer at the focus - I assure you, you do not get 27,000 degrees for a patch of blue sky this way, but you do get the right sort of temperature for the Sun.) It would have been better to just say "If you measure the light intensity vs. frequency profile for light from this patch of blue sky, the peak intensity is blah blah, which happens to be the same as the peak frequency of the light emitted by purely thermal radiation from a star whose surface is at 25,000 degrees C, isn't that interesting?" Or some such construct.
Note that light really does have a measurable temperature in yet another way that depends on both the average frequency of the light and on how 'thermalized' the light is. In this sense, light from thermal sources like the Sun or a furnace has just the kind of temperature you read about before asking the question, but light from other sources is generally "cooler". Fluorescent light would be "cool" and laser light "extremely cold". This sense is actually the most consistent and useful way I know of to talk about light and temperature, but few people seem to use it outside of people who actually use or study atomic physics or laser physics. I believe it is likely to become more popular in the future and then people will much less often be saying confusing and silly things about the temperature of the blue sky and so on.