I searched for hit or miss on the internet and Gonzalez's book but there is just a formula and example. In that example the hit or miss just finds a pixel and no more answers. I want to know by concept what is use and purpose of hit or miss transform.
The Hit-or-Miss transform as the name suggest uses 2 structuring elements (SE) to identify structures which are specific to the foreground (first SE) and background (second SE).
Here, you have a good example for corner detection. The only difference is that the two SE are merged into 1: The 1 are part of the foreground SE in order to determine a specific shape in the pattern, and the 0 are part of the background SE. Consequently, the algorithm hits only if all the conditions on the 1 and 0 are respected, else it's a miss.
This principle is mainly used for skeleton computation, but it can be derived to build all the mathematical morphology basic operations.