Oh ok thank you so much for the information I think you saved me a lot of time , I know you said that legally it isn't possible still there are ways I guess without getting the approval from a company like Samsung and yes I have rooted a phone , and yeah I guess telling you the end goal would help you help me understand better really I wanted to customize a tablet to be able to put pre installed systems on it and things of the sort and memory add ram basically create a super tablet of my own customization and as I understand you say that legally at the moment its not possible correct? Still it is possible illegally ? Say if it was to serve for education purposes only and such?
I hope you understand that nobody would go on the record on a public forum to tell you where to obtain bootleg documentation or code. Nobody wants to get sued. So on that front you are on your own.
"Customizing" a tablet by changing the hardware is pretty much impossible job to do for a hobbyist. Even if you manage somehow to deal with things like BGA chips and package-on-package (good luck!), without having the corresponding drivers you won't be able to make the modified hardware to work.
Also one of the main thing I wanted to do was run a system such as Ubuntu as the pre installed OS
Forget it. You would be hard pressed to make even the bare kernel boot on most of the consumer hardware today. That something is capable of running Android doesn't mean that it runs stock Linux kernel. Especially ARM is an ecosystem where every motherboard is totally different, with board-specific hacks in the kernel to make it work.
This is nothing like a PC where you have UEFI/BIOS, ACPI and similar things to bring up the machine, regardless of what is physically on the mobo. Here you
must talk directly to the hardware to initialize and configure it - a famous example of this is the Apple SMC chip that controls power to the most of the system. Its programming is undocumented and proprietary - and without talking to it the motherboard won't even turn on. Most phones and tablets use similar solutions, because it simplifies (the often complex) task of powering up the system.
If you want to try your hand building something like this, go rather with one of the Linux boards, as @cdev suggested above. Those are documented, there are plenty of accessories and the boards have tons of peripherals available. You have none of that on some random broken Android tablet that has been built down to a price without any regards for repairability, upgrading or public documentation - those machines are essentially designed to be disposable.