Ricotta cheese is made from whey left over from making cheeses using rennet, such as mozzarella. The whey is heated and an acidic element (such as vinegar, lime juice) is added to it to incite coagulation.
Paneer is made by adding an acid to hot milk.
To answer your question, you can make ricotta using whey left over after making mozzarella, but you cannot make it from whey left over from paneer as acids are used in it's production.
Note: if ricotta is made from whole milk it will be practically identical to paneer.