2% "and no compensation at this point" is not a good idea. My first startup with a couple of friends asking me to build them a site for 3% equity and some percentage of the sales. They valued their idea wayyyy too much. Half year later, they raised it to 15%.
If you can build it yourself and like the idea. You should do it. Their 2% with no salary is insulting.
Yes it is absolutely legal. Unless you signed a non disclosure agreement or they have a rock solid series of patents you can go right ahead and build it yourself.
You don't owe these mba clowns a damn thing. They are trying to cheat you. I wouldn't lose any sleep over it.
That said, these people sound pretty stupid. If I had to bet, I would say the idea is dumb.