While I've never done it, I don't imagine it would be very difficult if you have some basic experience with meshing. Off the top of my head this would be the process:
Extract the TS3 mesh and texture using the TS3 tool of your choice
Clone a TS4 hat that's as similar as you can find and extract the mesh and texture
Copy the TS3 hat texture and paste into the TS4 hat texture in the hat location
Adjust the TS3 mesh so the bottom is in the same position as the TS4 hat, and move/scale the uv to match the modified texture
In CAS Tools convert the new mesh to TS4 in the Mesh Tools / auto conversion tab
Import the converted mesh and texture into your cloned package
If you use Sims 4 Studio I think you'd have to use Blender to transfer the uv_1, weights, and vertex color before importing to your package.
Please do not PM me with mod, tutorial, or general modding questions or problems; post them in the thread for the mod or tutorial or post them in the appropriate forum.
Visit my blogs for other Sims content: Online Sims - general mods for Sims 3 Offline Sims - adult mods for Sims 3 and Sims 4