Open source licenses operate under copyright law, which governs permission to do certain things with the "creative work" under consideration. It covers permission to use, to modify, and to copy (get it yourself and pass it to somebody else). Open source is about allowing:
- Free distribution: Can pass it to whomever you want.
- Source code is available: So you can study how it works, build it yourself for your use (say another operating system or architecture).
- Derived works: It is allowed to change it, and allow to distribute changes under the same conditions you got the original.
- No discrimination against groups: No group of people can be excluded.
- No restriction of use: Can use it however you want
- No restriction of other software: Can not mandate or forbid use with other software.
(there are other provisions, which don't concern us here). So under an open source license, you are allowed to change it for your own use. You can pass your changes to others, but are not obliged to do so, the license can't even ask for you to share your changes with whoever originated the software, or notify them when you pass a copy around.
Note that there are lots of licenses going around, not all of them are truly open source even if they allow free sharing. For example, unrar is distributed freely as source code, but you aren't allow to modify it or study how it works.
Read and understand the license(s) of the stuff you want to use. If in any doubt, and there is a possibility of any significant risk, hire an expert lawyer and ask them.