I read on a blog that when you connect to a website with your phone they track the model number id of the device, or something like it. I don't remember what its called. Even if you change your sim card and connect again over cellular network, the website can detect that you connected with the same device. Is this true? Can it be prevented?
This is not true in general. Your connection is made via HTTP or HTTPS. Both don't carry your IMEI number. Some mobile carriers do transmit ADids, that are somewhat unique. It depends on your carrier wherever this id is generated from your phone number, your IMEI or not at all.
Other HTTP techniques such as cookies, flash cookies, local storage, your browser's cache (list incomplete) can still expose to the website that you're the same visitor.
If your carrier uses adids, than there is not much you can do except for using https on those sites (where it cannot be injected) or a VPN, which itself is an indicator due to the shared IP between sessions. If your carrier does not use adids you can clear your browser from cookies and similar or use it's private browsing mode.
You cellular network will know. They can see your IMEI.
Web sites shouldn't be able to. Assuming you were not providing info through the browser like keeping a cookie from session1 in the second one (eg. you are using a new incognito mode each time). They could see you are from the same ISP and perhaps draw a weak relationship (these users may be not too far) but not what you describe.
There was some years ago a mobile provider that installed a transparent proxy and added a header with your phone id / telephone number. If your provided did something as privacy-harming as that, the websites could fetch it.
As a similar concept, note that what you describe is similar to MAC addresses, but these can only be seen from the local network. A remote website doesn't get your MAC address since it goes through many routers.
Tracking the usage and packets over a network depends entirely on the existing laws of the land. In most countries, it is mandatory for the service providers to store some crucial data such as phone call recordings, SMSes, Inetrnet Surfing details and even missed calls and attempted calls for criminal investigations and related purposes while some prohibit it.
There are different ways of identifying your device: MacAddress, AndroidID (Android Devices), UDID (Apple Devices), GoogleAID, WindowsAID etc. For cellular mobile devices there are IMEI, IMEISV, MEID, ESN, IMSI etc.
So, a change of SIM card doesn't affect any of these and the reason these can be easily tracked by your network provider, is that ultimately your data travel through one of the routers owned and controlled by it.
As far as detection at website is concerned, the website can only detect if you enable cookies through which the website stores some identification information on your device's browser. For example, when you login to Facebook and check the "Remember me" box, you allow Facebook to store cookie. The next time you use the same browser for Facebook, you are automatically logged in.
Disable cookies or clear them to avoid being tracked.