Is the main idea and topic sentence same in a paragraph?

Not exactly, though they are related. The reader discerns the main idea from the topic sentence.