Is it secure to use Microsoft Teams for quizzes?
Assuming you mean a quiz written as a Microsoft Forms quiz and using the Teams assignment tab for submission and collation, then I believe it's robust to that particular attack, since it is literally a web form, and the marking and score generation seem to happen server side.
On the other hand there are plenty of attacks that it isn't secure to. Not least students communicating with each other, either through Teams directly (for the non-creative students) or out of band (e.g. via a mobile phone). And unfortunately both multiple choice and true-false are harder to plagiarism check than freeform text.