Can I leave the basket in the portafilter after pulling the shots? Because it is quite hard to take the basket out of the portafilter, I tend to leave it there. But this means I can't clean the space between them. Is that OK?
The space between them is very hot to be cleaned right after preparing the espresso, actually. It is better to wait for a while and then remove the portafilter to clean if you are not planning to prepare a second one right after. See image below from a manual.







The space in between can be cleaned after given number of use. E.g. after every 50 use.

Normally, I tend to use decalcifying agents after per 100-150 use. Then, I also remove the parts and clean thoroughly. Otherwise, I just wipe the space in between with a wet cloth.