Ive been reading about flashing a stock car and how it improve the way it runs plus it adds few extra pones

.
My qustion is.. would the dealership be able to tell if the ecu has been flashed? is our ecu has the abillty to count how many times it has been flashed and store it in its memory?
I read about Ecutek looking the ecu, wouldnt that leave a trace in the ecu itself?
Sorry for the noob questions, im sure this subject has been discussed before, tried searching but no luck.
Thanks.