I'm new and wonder what the general feeling is regarding a bit of chat during play. Obviously, some will like it and some won't but are there any 'rules' I should be aware of?
In live chess, I don't think you'll get many replies and it could be distracting. In online chess then I think it's encouraged.
Always say gg, although they might be offended if you wish them luck before the game. These messages must be well-thought out or they will find some way to be offended.
Profanity of any kind is of course forbidden. There is some kind of auto censor that has a list of "naughty" words. Belittling your opponent is also frowned on. Usually folks just disable chat in that case, but they do have the right to report you, and some do. I usually just start with "Hi" or maybe a "thankyou for agreeing to play with me" and if I get a response it's on to "good luck, I'm sure we'll have a fun game" As you surmised, some chat and some don't. If you're playing someone using their cell phone, they may not even see your chat so don't be automatically offended if you don't get an answer.
I think talking during the game should be discouraged unless you are using it as a learning exercise. If it is a slow game, I will wish the opponent good luck and spend time analysing it afterwards. For a quicker game I will just say gg afterwards. Most players choose to leave the chat without saying anything.