We have freedom of speech in our country, and politicians, and everyone else, has the right to say whatever they want. It might not be politically profitable to say things that are untoward while in office, but politicians have every right to say them. Sometimes the truth can be difficult to hear.
Yes, politicians have the right to say untoward things in office, because they can speak their opinion just like anyone else. However, a politician gets a very public job review every time they are up for re-election. If the public does not like what they have to say, they are free to vote for someone else next time. But yes, they make speak their mind like anyone else.
Politicians usually shouldn't say untoward things in office because it can hurt their reputation. However, sometimes it pays off to be open and candid while in office. They absolutely have the right to say such things, even though they shouldn't necessarily do so. Either way, polticians have freedom of speech just like us.
To be honest, I am not really sure what "untoward things" means. However, it doesn't matter because people pretty much have the right to say anything they want. That is free speech. They don't have a right to make threats to harm others but they do have the same right to free speech as the rest of us.
Politicians should not be saying untoward things in general whether they are running for office, in office, or recently retired. If you are in the public eye you should act like a role model and be an honest person at all times. It is important to tell the truth so we can rely on them.