Can somebody suggest what should be the optimal font size of text like axis ticks, axis label, legend etc. ?
Your institution's thesis template may specify this - some do and some don't. If not then it's really up to you. Typically, you want it to be smaller than your main text so that it doesn't stand out inappropriately much. Beyond that, it's a balance for efficacy of communication: larger sizes are more legible, but smaller sizes can help avoid visual clutter. Remember also that many of your readers may be older or have imperfect vision and have a hard time with smaller fonts.
Try to use the same font as what you use for image captions. Then it should be easy to read and it does not stand out in comparison with the rest of the document.
For example, if your text is 12pt Times and image captions are 11pt Times, then all text in your images is 11pt Times. If both text and image captions are 12pt Times, then all text in your images is also 12pt Times.
(In exceptional cases you can try to save space by using a slightly smaller font.)