When you install an app in your phone, first off all it asks you for permissions. These permissions include Phone information, Sim Information, Contacts, Files Access etc. So basically if they have all your phone information including your IMEI they can easily find out you're the same user. However, most apps will not care to do that much research and will treat you as a new user if you clear your app data.