Difference between 同一 and 一样
Generally,

同一 means identical and is usually used on identities.

一样 means equivalent and is usually used on properties or results.


Examples:

我们去过同一个商店。We've been to the same store.
这两个商店卖的东西是一样的。These two stores sell the same stuffs.
同一首歌，不同的人唱，感觉是不一样的。The same song doesn't sound the same when it's sung by different singers.

Note there are some (idiomatic) exceptions to these rules, which can be another topic.

Since you've mentioned 'similar', neither of these two words means 'similar'. You may want to use 类似, 相似, 差不多 for similar.
For example:

我有过类似的遭遇。I've had a similar experience.
我们的性格很相似. We're much alike in character.
几个目击者的说法都差不多. What the witnesses said are pretty much the same thing.