In all three scenarios you can be sued. Whether it sticks or not is a different matter and depends on a lot of different things.
Edit.
I find it interesting you say all 3 scenarios when the 3rd one is all unique code.
For example. If we look at behavioral marketing.
mouseflow hotjar navilytics fullstory crazyegg
+ im sure there is more.
What you are saying, is that any of these guys could sue each other? For what, copying the same idea and executing it?