Broadly speaking, yes, you can sell modified open source software. However, you *usually* don’t sell the software itself, but the services that go around it, like deployment and training. That’s the most common scenario. Another scenario is that you derive another product from the original software and re-sell it.
That said, it should be noted that there are several scores of open source licenses that allow varying levels of liberty to the person adopting it, either for a) their own use (which is almost always without any hitches), or b) for the purpose of re-packaging it and selling it (as the OP wants to know about).
We talk about this second use case in the answer that follows.
What you can do with the software depends on the specific license that goes with it. So, for instance, “copylefted” licenses like GPL (General Public License) allow you to be able to re-package the software with the rider that the derived product should also be open source and bear the same or another, more copylefted license. Hence GPL is known as a viral license, and this is precisely the reason many businesses avoid GPL’s software even though it is both open source and free. They are wary of it because GPL is considered a business-unfriendly license.
On the other hand you also have LGPL (Lesser GPL) which is not as viral as GPL, and is often used for software components by library authors who want to keep their products free. This license allows one using the software component to keep their own code closed source as long as the library in question is linked to dynamically and not statically. (A little technical stuff here, but should suffice for now.)
And then there are some pretty liberal and permissive software licenses, two of which that immediately come to mind are the MIT and BSD licenses. Businesses love these licenses because they allow them to do pretty much anything they want with the software. These licenses impose minimal restrictions on the use and distribution of the software.
And at the far end of the open source spectrum is the public domain license. This license is — believe it or not — not a license at all, because the author has bequeathed their software to the public domain, which consequently makes it forever free. And what’s more is that the author has also relinquished any rights over the software’s intellectual property aspects, if any.
Yet another factor to consider is that OPEN SOURCE software does not automatically equate to FREE software. There are some cases where the software is open source but not free, though this is the rare case.
In conclusion, I would like to reiterate that legal issues are something to watch out for only when you want to re-package an open source software or create a derived product; it’s rare to land into legal problems when it comes to using it, either for yourself or for your company.
Finally, I would like to add that I am not a lawyer, and I can only shed so much light on this subject based on my understanding of it. You may want to consider consulting a legal professional before taking a call on a decision like this.