Let's say I'm taking Lufthansa from US and then to a third country. But the thing is that I want to stay in Germany for a few days. I know that travel agents can change one leg of a journey. Is it possible to do it online as well?
This depends on two factors:
Regarding ticket type, is it a flexible ticket type? Is it refundable? Most likely this will be shown in the ticket details. If it is flexible then you need to make sure that the website were you made the reservation has the ability to change the reservation. Most airlines' websites have this ability. You can simply login and open your booking and change it. Things are not that easy with other online travel agencies and this varies from one website to another and some require you to call a number to do that.