Well, it depends on the context. Let me present two situations.
IN = inside
ON = Place something above another so that the former touches the latter.
Situation 1: ‘IN’
Since investment (money) is not placed above a product but inside it, investment is never ON but IN. You invest inside a company, inside gold, inside a business (become a part of them).
Correct: invest in something.
Situation 2: ‘ON’
ON = used to refer to a position/ process. (the house is on fire)
So, when you follow a process before investing, it uses ON.
I invest on the basis of Warren Buffet’s advice.