Hi Vicky, here's a youtube video on how to make it! https://www.youtube.com/watch?v=oJBLgCx-BTc
Irregardless of whatever material you use to construct a fence, the stability of the fence will depend on the degree to which the posts are anchored down into the ground sturdily.
Pallet wood may not be long enough, strong enough, or straight enough to use as proper posts.
Here are some posts from Hometalkers on doing this kind of project: https://www.hometalk.com/search/posts?filter=pallet%20fence.