I don't see why this would be illegal. You already paid for the software; you might as well customize it to your liking.
In the case of games...modding communities are huge and designers often include modding tools for doing things like what you described, so I doubt they have a problem with it. It gives their game more replay value, and I'm sure they want happy customers.
Now, if you were modding a game/program and selling it, then that might be crossing the line.