UK visa for visiting position I plan to stay as a visiting teachers in two UK universities (for teaching purpose), and made some agreements. However, I wish to personally visit the universities before final agreement.

Obviously, I need a one-year visa. If I enter the UK by visa waiver, can I obtain this visa/permission to stay within the UK? Or I must enter the UK with one-year visitor visa to be eligible for working in universities (not paid of course).
I am assuming you are a US citizen.

The visa waiver scheme would cover a less than 6 month visit to the universities before the final agreement. Once you are ready to come over semi-permanently, you will need a Business Visitor Visa which can last up to a year for academic visitors. The application guidance says


  Apply in the UK: You can only extend your visa if you’re already in the UK.


Switching for the visa waiver scheme to the Business Visitor Visa would not be considered an extension of the Business Visitor Visa, so you will need to apply from outside the UK.

It is worth noting that UKVI could get a bit touchy about you visiting the UK prior to applying for the visa. For example, if you spent 6 months in the UK on the visa waiver scheme, and then immediately applied for a year long Business Visitor Visa after returning to the US, they might reject your application. A week long visit and only applying for a 51 week Business Visitor Visa would probably appease them.