Modify plugin and submit to directory

It depends on the license of the source plugin. In case you’ve downloaded that plugin from WordPress Plugins Directory, then you can modify and upload it as it inherits the GPLv2 license of WordPress itself or GPLv2-compatible license of the modified plugin.

Here are some guidelines.

Also, it’s polite to mention the original author (“Inspired by:”, “Based on the plugin of:” etc.).

Edited: Licensed precised, link added.