Can I paint a texture within the UV viewport?
In Uv Editor switch the Mode to Paint. Open a Tools panel (T) and select a brush.



Now you can paint. 
Remember to save your image when you're done with painting (Image-->Save As Image). When you see a little star (*) next to the Image in header it means that the image isn't saved.



Here are some useful shortcuts that can be used in a UV Editor window:


press S to pick a color sample
hold S and press LMB to add a color sample to your palette (you may also do it pressing a + button located under the circular color palette).





press F to change the size of a brush 
press Shift+F to change the strenght of a brush


After pressing the shortcuts you may also change the attributes of a brush using numerical keyboard buttons.




press E to change the stroke method


Here you can find many interesting options (like a Curve stroke- very useful for precise painting). 




press X to quickly flip the color slots