The correct answer is always to check you local (faculty) rules for theses.
I'm not from TCS, but here are my 2 ct:
If the same chapters are actually papers in a staple (cumulative) thesis, that is acceptable over here (the papers will appear as their print version in cumulative theses). We have rules that establish a point system depending on who is first and who is second author.
Here's an example: student T focuses more on theory and student A on an application (or maybe for TCS, on simulation?). Then 2 papers (not LPUs) are written, one focusing on theory with short application example with T 1st author and A 2nd author; the other paper discussing the application in detail and just briefly the theory. Here authorship is the other way round. Both students can take both papers into their theses, and each gains 1.5 publication points. If, say, the application example isn't worth a full paper, then only 1 paper is written and T gains 1 point, while S gains only 0.5 points (not being the first author). Both put the complete paper into their thesis.
In any case, the non-stapled parts of the theses need to be different in order to establish who did what part of the work, because the degree is given for the own work of each student. So if all work was done as team work, there will probably be trouble because the committee cannot know how to assign grades to whom.