Does open source mean that anyone can do anything with the code?

Open source explained in plain language.

No. Open source gives many rights, but always within the terms of the license.

These conditions may, for example, concern attribution, retaining license texts or sharing changes under the same license.