If you're talking about a paragraph, they are almost the same thing. The topic sentence is one sentence, beginning with a capital letter and ending with a period. It might be at the beginning or the end of the paragraph.
The main idea sentence can be exactly the same thing. But sometimes the main ideas are spread over more than one sentence.