Can I use Code EAN for other purposes than retail?

Yes, but it is not recommended. The contents, size and layout of Code EAN are all standardized which makes the code unsuitable for most purposes outside retail (e.g. warehouse management or asset tracking). You must also anticipate that barcodes from outside your company can interfere with your own codes, a so called number collision.

The biggest issue with the normal EAN 13 is that you can only encode exactly 12 digits (plus mandatory checksum). This would involve padding your data with "0" if you have less data or truncating it if you have more. Furthermore, EAN can only encode numbers so you wouldn't be able to encode, say, article numbers with letters in it.