Do we have rights to edit the source of the templates which are in wordpress.org?

Normally you can find information regarding the license in the style.css file located in the root of the theme.

Open it with a text editor (or in the admin panel Administration > Appearance > Editor) and check the comment, if it says something like this:

License: GNU General Public License v3

License URI: http://www.gnu.org/licenses/gpl.html

Then you are free to modify it however you like. If there’s no information regarding the license in this file, then check the folder for README file, but in most cases it should be in style.css.

I believe that most if not all official WordPress themes are under GNU license, but it’s always better to check your theme before editing it.