You're always locked in, so you need to make sure that you can adapt it as needed. Either because you already own it (homegrown) or because you're prepared to take ownership if needed (FOSS done right).
For commercial software (or FOSS-as-appliance) then you're stuck going along wherever your vendor wants to take you.