Arduino and Raspberry Pi are open-source development boards. This means that all details of their designs are publicly available to you.
You are allowed to copy the design and use it as a starting point for your own custom design, but the resulting new design must also be classified as open source (Creative Commons CC-BY-SA).
You are also legally permitted to embed any of these off-the-shelf development kits directly in a commercial product. The only requirement is that you say “Powered by Arduino” or “Powered by Raspberry Pi” somewhere on the package or in the instructions.
There are also various other proprietary development boards available from companies such as ST Microelectronics and Texas Instruments. These are primarily for evaluating their microcontroller chips, but in most cases they can also be embedded in a product.
So the answer is, yes, you can use most off-the-shelf development kits inside a commercial product. But the real question you should be asking is should you use a development kit inside your product.
As the name implies, development kits are primarily designed for development and early prototyping, not for mass production.
Why shouldn’t you use them for production? It generally comes down to three reasons: cost, size, and power consumption.
An Arduino Uno costs about $20. If you instead designed your own custom PCB with the same functionality, it would cost only a few dollars.
For example, the ATMega328P is the microcontroller used on the Uno. This chip only costs a little over a dollar at low quantities. There are also lower cost microcontrollers available with similar or better performance.
The other main chip on the Uno is a USB-to-UART converter chip. This can be eliminated for a production product since the ability to program via a USB port using the Arduino IDE is no longer required.
This just leaves a few really low cost components such as a linear regulator, a crystal, and any connectors. The passive components (resistors and capacitors) only cost pennies.
If you were going to replicate an Arduino exactly then you’d also of course have the cost of the PCB itself and the cost of soldering on the components. However, since you will likely also still require a custom PCB for other parts of your circuit, this cost is absorbed into the cost of your custom PCB.
Regardless of the development kit, they will always be considerably more expensive than designing your own custom PCB solution.
Development kits are ideal for early prototypes, but not for production.
The other downside to embedding a development kit like an Arduino or Raspberry Pi into your product is the large size. Arduino’s and Raspberry Pi’s are quite large and were never designed with small size as a priority.
For example, if your product is a smart watch, then obviously these kits aren’t practical at all. Good luck fitting an Arduino in a watch! In fact, I’d say these kits are too large for probably 80% of products.
In addition to their large size, they also likely include functions or features that you don’t require. These features may significantly increase their size.
For example, an Arduino Uno uses a large USB type-B connector, but you may wish to instead use a small microUSB connector.
The case is even worse with a more advanced kit such as a Raspberry Pi which includes an Ethernet connector, four USB type-A connectors, and HDMI connector, etc.
If you don’t require these connectors for your application then this adds a lot of additional size and weight to your product.
Increased Power Consumption
Not only do any unnecessary functions add cost and size to your product, but they also increase the power consumption.
This isn’t critical if the product is powered from an external power source. But it becomes very important for battery powered products.
For example, the USB-to-UART chip used on the Arduino Uno can consume an extra 20mA of current when active. For a product running from a small battery this can have a significant impact on battery life.
Whether it is additional cost, size or power consumption, it rarely makes sense to include unneeded functions in your product.
Although you can legally use a development kit in a commercial product it doesn’t usually make sense to use them for anything other than development and prototyping. This is especially true with more simple microcontroller based kits like an Arduino.
Most products still require a custom PCB be developed for any functionality required outside of the development board. If you are already having to develop, prototype, and manufacture a custom board, then in most cases it makes sense to embed the microcontroller on this same board.
There are a few exceptions, though, where an Arduino may be a viable production solution. If your product is larger sized, has a high retail price, is not battery powered, and doesn’t need a custom PCB.
For a microprocessor based product it’s a bit of a different story. Duplicating the functionality of the Raspberry Pi on your own custom PCB is a very complex process with significant development risk.
Rarely do I recommend designing a custom microprocessor board, at least initially. That should usually be done later once you reach significant production volumes.
However, there are better microprocessor boards available to use in production. The RPi is simply not designed for large scale production so you may run into availability issues or unexpected changes to the RPi itself.
If you need help migrating your product from an Arduino or Raspberry Pi to a production design then definitely check out the Predictable Hardware Report.