There is absolutely nothing dangerous about freezing a tub of yogurt before it reaches its expiration date. It in no way affects the healthy live and active cultures. However, the damage happens when it’s thawed. After being thawed, the yogurt looses its creaminess and becomes grainy.
Although you won’t get sick from eating thawed out leftover pasta, you will probably not enjoy it, as the pasta will likely get mushy when you remove it from the freezer. You might have better luck with noodles that are cooked al dente.
Since you probably don’t want mushy pasta, it is likely you won’t want mushy rice either. Which is why cooked rice should never be kept in the freezer. It isn’t dangerous to eat, but it will lose its taste and texture.