My question is about the case when an app is published on Google Play as a demo, but it is also distributed on a web-site:
1-with another developer signature
2-with no signature.
I would like to know if when installing from outside Google Play (case 1 & 2) the app will overwrite the old demo app, provided the user gave permission to install non-Google Play apps.
with no signature
Unsigned APKs cannot be installed.
if when installing from outside Google Play (case 1 & 2) the app will overwrite the old demo app
No, because the signatures will not match. The installation will simply fail.