Yes that is possible and legal.
You just have to ask both of your employers if it is ok to have the second job. But usually this is no problem.
However, your employer has the right of veto if
- You are impaired in your performance by the side job, for example if you work as a DJ in a disco at night and are tired and unfocused at your main employer during the day;
- you directly or indirectly compete with your employer with the second job;
- a part-time job during the holidays endangers the purpose of your holiday;
- you take the part-time job during a sick leave and thus endanger your recovery;
- the two jobs exceed the legally permissible maximum working time or break and recovery times are not observed. https://spielraum.xing.***/wp-content/uploads/2016/02/checkliste-arbeitszeiten.pdf
All the best,