Can you modify and sell open source code?

Open source explained in plain language.

Yes, open source should allow for customization. Sales are also possible, as long as the licensing conditions are followed.

Some licenses require that you provide or make available the modified source code when you distribute the modified work.