▻ MATRIX-TYPE THOUGHTS
How can you know that your thoughts are really your thoughts and not induced or created by another entity (evil demon, karma, an AI machine in the Matrix, etc)?
I think you are skidding on 'your'. They are only not 'your' thoughts in the sense that they have been externally induced (without your knowing it). But they are still 'your' thoughts in the sense that you have them. However they came about, the thoughts are within your consciousness and hence are 'yours'.
▻ DESCARTES AS A THINKING ENTITY
Was Descartes wrong assuming that you are a thinking entity?
It isn't strictly correct to say that he assumed this. His first certainty was 'I think (and thinking), I exist' (Meditation 2). In the more usual form, 'I think, therefore I exist' only has a point-instant certainty. It is true only whenever it is enacted. If X enacts the thought now, and enacts it five minutes later, it does not follow (and Descartes does not think it does) that X has had a continuous existence as an entity between the two enactments.
Take a parallel with a clock : whenever it is working it shows the right time. Because it shows the right time on Monday and the right time on Wednesday, it does not follow that the clock has had a continuous existence between the two days. It may have been dismantled on Tuesday and not existed as a clock at all.
Descartes argues the case for his being a thinking entity (a continuant). It is may not be a cogent argument but it is an argument, set out in Meditations 2 and 6.
Is Buddha right [in] assuming that you are not your mind and your mind creates your ego (idea of the self) which is also an illusion and you don’t need to think to know you exist?
I am not sure about the exact line of thought here. Probably my fault. But if it is an illusion that one is one's mind and an illusion (generated by the mind) that one is an ego or self, the question naturally suggests itself : to whom or what do the illusions occur ? Who or what is 'illuded' ? There can't be an illusion without something that has it. What is the 'one' that is not its mind and is not an ego or self ? What remains to have the illusions ?
If 'one' is itself an illusion, the question recurs : to whom or what does the illusion of being 'one' occur ?
J. Cottingham, Descartes, Oxford : Blackwell, 1986, ch. 2.
Alan Tomhave, 'Cartesian Intuitions, Humean Puzzles, and the Buddhist Conception of the Self', Philosophy East and West, Vol. 60, No. 4 (OCTOBER 2010), pp. 443-457.