in the Trek universe, yes.
Realistically, no. They were deliberately designed to be relatively simple tools with basic programming. Machines can't naturally "evolve" the way organic beings can.(not to mention that individuals don't really evolve) At least in the case of Data or Lore they were DESIGNED to be self-aware.
"QOL" would ask us to accept that simple machines accidentally evolved into self-awareness. Riiiight.