to discover the algorythm running on an Arduino
Yes it is difficult but it is possible.
Is there any possibility to someone who buy the product to know that code?
Yes they could if they wanted to disassemble the code into machine code. The underlying C code is not always clear from this.
It is possible on other processors to lock the device so it can't be read but not this one.
Some processors even have a scrambling algorithm built in so you have to use your "password" in order to program and run the processor.